Class TransportFactory
java.lang.Object
org.apache.activemq.transport.TransportFactory
- Direct Known Subclasses:
FailoverTransportFactory, FanoutTransportFactory, MockTransportFactory, TcpTransportFactory, UdpTransportFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TransportServercompositeConfigure(Transport transport, WireFormat format, Map options) Similar to configure(...) but this avoid adding in the MutexTransport and ResponseCorrelator transport layers so that the resulting transport can more efficiently be used as part of a composite transport.static TransportcompositeConnect(URI location) Creates a slimmed down transport that is more efficient so that it can be used by composite transports like reliable and HA.static TransportcompositeConnect(URI location, Executor ex) Creates a slimmed down transport that is more efficient so that it can be used by composite transports like reliable and HA.static TransportcompositeConnect(URI location, SslContext sslContext) configure(Transport transport, WireFormat wf, Map options) Fully configures and adds all need transport filters so that the transport can be used by the JMS client.static TransportCreates a normal transport.static TransportCreates a normal transport.static Transportconnect(URI location, SslContext sslContext) protected TransportcreateTransport(URI location, WireFormat wf) Factory method to create a new transportprotected TransportcreateTransport(URI location, WireFormat wf, SslContext sslContext) SSL-aware createTransport override point used bydoConnectInternal(URI, SslContext, boolean).protected WireFormatcreateWireFormat(Map<String, String> options) protected WireFormatFactorycreateWireFormatFactory(Map<String, String> options) abstract TransportServerdoBind(URI location, SslContext sslContext) Default implementation delegates to the single-arg method, ignoring the SslContext.doCompositeConnect(URI location) doCompositeConnect(URI location, Executor ex) doCompositeConnect(URI location, SslContext sslContext) Default implementation delegates to the single-arg method, ignoring the SslContext.doConnect(URI location, SslContext sslContext) Default implementation delegates to the single-arg method, ignoring the SslContext.protected TransportdoConnectInternal(URI location, SslContext sslContext, boolean composite) Shared implementation behinddoConnect(URI)/doCompositeConnect(URI)and the SslContext-carrying overrides in SSL capable subclasses.static TransportFactoryfindTransportFactory(URI location) protected Stringprotected Stringstatic voidregisterTransportFactory(String scheme, TransportFactory tf) Allow registration of a transport factory without wiring via META-INF classesserverConfigure(Transport transport, WireFormat format, HashMap options) Fully configures and adds all need transport filters so that the transport can be used by the ActiveMQ message broker.
-
Constructor Details
-
TransportFactory
public TransportFactory()
-
-
Method Details
-
doBind
- Throws:
IOException
-
doBind
Default implementation delegates to the single-arg method, ignoring the SslContext. Subclasses (e.g. SslTransportFactory) override to use the context for SSL socket creation.- Throws:
IOException
-
doConnect
public Transport doConnect(URI location, SslContext sslContext) throws IOException, URISyntaxException Default implementation delegates to the single-arg method, ignoring the SslContext. Subclasses (e.g. SslTransportFactory) override to use the context for SSL socket creation.- Throws:
IOExceptionURISyntaxException
-
doCompositeConnect
public Transport doCompositeConnect(URI location, SslContext sslContext) throws IOException, URISyntaxException Default implementation delegates to the single-arg method, ignoring the SslContext. Subclasses (e.g. SslTransportFactory) override to use the context for SSL socket creation.- Throws:
IOExceptionURISyntaxException
-
doConnect
- Throws:
IOExceptionURISyntaxException
-
doCompositeConnect
public Transport doCompositeConnect(URI location, Executor ex) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
connect
Creates a normal transport.- Parameters:
location-- Returns:
- the transport
- Throws:
IOExceptionURISyntaxException
-
connect
public static Transport connect(URI location, SslContext sslContext) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
connect
Creates a normal transport.- Parameters:
location-ex-- Returns:
- the transport
- Throws:
IOExceptionURISyntaxException
-
compositeConnect
Creates a slimmed down transport that is more efficient so that it can be used by composite transports like reliable and HA.- Parameters:
location-- Returns:
- the Transport
- Throws:
IOExceptionURISyntaxException
-
compositeConnect
public static Transport compositeConnect(URI location, SslContext sslContext) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
compositeConnect
public static Transport compositeConnect(URI location, Executor ex) throws IOException, URISyntaxException Creates a slimmed down transport that is more efficient so that it can be used by composite transports like reliable and HA.- Parameters:
location-ex-- Returns:
- the Transport
- Throws:
IOExceptionURISyntaxException
-
bind
- Throws:
IOException
-
doConnect
- Throws:
IOExceptionURISyntaxException
-
doCompositeConnect
- Throws:
IOExceptionURISyntaxException
-
doConnectInternal
protected Transport doConnectInternal(URI location, SslContext sslContext, boolean composite) throws IOException Shared implementation behinddoConnect(URI)/doCompositeConnect(URI)and the SslContext-carrying overrides in SSL capable subclasses.compositeselects the slimmed-down form used by reliable/HA transports (nowireFormat.hostdefault,compositeConfigure(Transport, WireFormat, Map)instead ofconfigure(Transport, WireFormat, Map), and noauto.*strip). The SslContext is threaded tocreateTransport(URI, WireFormat, SslContext)— plain transports ignore it, SSL capable ones derive their socket factory from it — so the connect template lives here once rather than being copied per transport.- Throws:
IOException
-
registerTransportFactory
Allow registration of a transport factory without wiring via META-INF classes- Parameters:
scheme-tf-
-
createTransport
Factory method to create a new transport- Throws:
IOException
-
createTransport
protected Transport createTransport(URI location, WireFormat wf, SslContext sslContext) throws IOException SSL-aware createTransport override point used bydoConnectInternal(URI, SslContext, boolean). The default ignores the SslContext and delegates tocreateTransport(URI, WireFormat); SSL capable subclasses (e.g. TcpTransportFactory) override this to derive their socket factory from the context, so the connect template does not have to be duplicated per transport.- Parameters:
sslContext- the SslContext to use, or null for the JVM default.- Throws:
IOException
-
findTransportFactory
- Parameters:
location-- Returns:
- Throws:
IOException
-
createWireFormat
- Throws:
IOException
-
createWireFormatFactory
- Throws:
IOException
-
getDefaultWireFormatType
-
configure
Fully configures and adds all need transport filters so that the transport can be used by the JMS client.- Parameters:
transport-wf-options-- Returns:
- Throws:
IOException
-
serverConfigure
Fully configures and adds all need transport filters so that the transport can be used by the ActiveMQ message broker. The main difference between this and the configure() method is that the broker does not issue requests to the client so the ResponseCorrelator is not needed.- Parameters:
transport-format-options-- Returns:
-
compositeConfigure
Similar to configure(...) but this avoid adding in the MutexTransport and ResponseCorrelator transport layers so that the resulting transport can more efficiently be used as part of a composite transport.- Parameters:
transport-format-options-- Returns:
-
getOption
-