Package org.apache.qpid.jms.transports
Class TransportFactory
java.lang.Object
org.apache.qpid.jms.transports.TransportFactory
- Direct Known Subclasses:
NettyTcpTransportFactory,NettyWsTransportFactory
Interface that all Transport types must implement.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TransportOptionsapplyTransportConfiguration(TransportOptions transportOptions, Map<String, String> transportURIOptions) Apply URI options to a freshly createdTransportOptionsinstance which will be used when the actualTransportis created.static TransportStatic create method that performs the TransportFactory search and handles the configuration and setup.createTransport(URI remoteURI) Creates an instance of the given Transport and configures it using the properties set on the given remote broker URI.protected abstract TransportdoCreateTransport(URI remoteURI, TransportOptions transportOptions) Create the actual Transport instance for this factory using the provided URI and TransportOptions instances.protected TransportOptionsCreate and return an instance of TransportOptions appropriate for the Transport type that this factory will return.static TransportFactoryfindTransportFactory(String transportKey) Searches for a TransportFactory by using the scheme from the given key.abstract StringgetName()booleanisSecure()
-
Constructor Details
-
TransportFactory
public TransportFactory()
-
-
Method Details
-
createTransport
Creates an instance of the given Transport and configures it using the properties set on the given remote broker URI.- Parameters:
remoteURI- The URI used to connect to a remote Peer.- Returns:
- a new Transport instance.
- Throws:
Exception- if an error occurs while creating the Transport instance.
-
doCreateTransportOptions
Create and return an instance of TransportOptions appropriate for the Transport type that this factory will return.- Returns:
- a newly allocated TransportOptions instance appropriate to the factory.
-
applyTransportConfiguration
protected TransportOptions applyTransportConfiguration(TransportOptions transportOptions, Map<String, String> transportURIOptions) Apply URI options to a freshly createdTransportOptionsinstance which will be used when the actualTransportis created.- Parameters:
transportOptions- TheTransportOptionsinstance to configure.transportURIOptions- The URI options to apply to the givenTransportOptions.- Returns:
-
doCreateTransport
protected abstract Transport doCreateTransport(URI remoteURI, TransportOptions transportOptions) throws Exception Create the actual Transport instance for this factory using the provided URI and TransportOptions instances.- Parameters:
remoteURI- The URI used to connect to a remote Peer.transportOptions- The TransportOptions used to configure the new Transport.- Returns:
- a newly created and configured Transport instance.
- Throws:
Exception- if an error occurs while creating the Transport instance.
-
getName
- Returns:
- the name of this Transport.
-
isSecure
public boolean isSecure()- Returns:
- true if the Transport that this factory provides uses a secure channel.
-
create
Static create method that performs the TransportFactory search and handles the configuration and setup.- Parameters:
transportKey- The transport type name used to locate a TransportFactory.remoteURI- the URI of the remote peer.- Returns:
- a new Transport instance that is ready for use.
- Throws:
Exception- if an error occurs while creating the Transport instance.
-
findTransportFactory
Searches for a TransportFactory by using the scheme from the given key. The search first checks the local cache of Transport factories before moving on to search in the class-path.- Parameters:
transportKey- The transport type name used to locate a TransportFactory.- Returns:
- a Transport factory instance matching the transport key.
- Throws:
IOException- if an error occurs while locating the factory.
-