Package org.apache.activemq.transport
Class TransportFactory
- java.lang.Object
-
- org.apache.activemq.transport.TransportFactory
-
- Direct Known Subclasses:
AmqpWSTransportFactory,FailoverTransportFactory,FanoutTransportFactory,HttpTransportFactory,MockTransportFactory,PeerTransportFactory,TcpTransportFactory,UdpTransportFactory,VMTransportFactory,WSSTransportFactory,WSTransportFactory
public abstract class TransportFactory extends Object
-
-
Constructor Summary
Constructors Constructor Description TransportFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static TransportServerbind(URI location)TransportcompositeConfigure(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.Transportconfigure(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 Transportconnect(URI location)Creates a normal transport.static Transportconnect(URI location, Executor ex)Creates a normal transport.protected TransportcreateTransport(URI location, WireFormat wf)Factory method to create a new transportprotected WireFormatcreateWireFormat(Map<String,String> options)protected WireFormatFactorycreateWireFormatFactory(Map<String,String> options)abstract TransportServerdoBind(URI location)TransportdoCompositeConnect(URI location)TransportdoCompositeConnect(URI location, Executor ex)TransportdoConnect(URI location)TransportdoConnect(URI location, Executor ex)static TransportFactoryfindTransportFactory(URI location)protected StringgetDefaultWireFormatType()protected StringgetOption(Map options, String key, String def)static voidregisterTransportFactory(String scheme, TransportFactory tf)Allow registration of a transport factory without wiring via META-INF classesTransportserverConfigure(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.
-
-
-
Method Detail
-
doBind
public abstract TransportServer doBind(URI location) throws IOException
- Throws:
IOException
-
doCompositeConnect
public Transport doCompositeConnect(URI location, Executor ex) throws Exception
- Throws:
Exception
-
connect
public static Transport connect(URI location) throws Exception
Creates a normal transport.- Parameters:
location-- Returns:
- the transport
- Throws:
Exception
-
connect
public static Transport connect(URI location, Executor ex) throws Exception
Creates a normal transport.- Parameters:
location-ex-- Returns:
- the transport
- Throws:
Exception
-
compositeConnect
public static Transport compositeConnect(URI location) throws Exception
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:
Exception
-
compositeConnect
public static Transport compositeConnect(URI location, Executor ex) throws Exception
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:
Exception
-
bind
public static TransportServer bind(URI location) throws IOException
- Throws:
IOException
-
doCompositeConnect
public Transport doCompositeConnect(URI location) throws Exception
- Throws:
Exception
-
registerTransportFactory
public static void registerTransportFactory(String scheme, TransportFactory tf)
Allow registration of a transport factory without wiring via META-INF classes- Parameters:
scheme-tf-
-
createTransport
protected Transport createTransport(URI location, WireFormat wf) throws MalformedURLException, UnknownHostException, IOException
Factory method to create a new transport
-
findTransportFactory
public static TransportFactory findTransportFactory(URI location) throws IOException
- Parameters:
location-- Returns:
- Throws:
IOException
-
createWireFormat
protected WireFormat createWireFormat(Map<String,String> options) throws IOException
- Throws:
IOException
-
createWireFormatFactory
protected WireFormatFactory createWireFormatFactory(Map<String,String> options) throws IOException
- Throws:
IOException
-
getDefaultWireFormatType
protected String getDefaultWireFormatType()
-
configure
public Transport configure(Transport transport, WireFormat wf, Map options) throws Exception
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:
Exception
-
serverConfigure
public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception
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:
- Throws:
Exception
-
compositeConfigure
public Transport compositeConfigure(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.- Parameters:
transport-format-options-- Returns:
-
-