org.apache.activemq.transport
Class TransportFactory

java.lang.Object
  extended by org.apache.activemq.transport.TransportFactory
Direct Known Subclasses:
FailoverTransportFactory, FanoutTransportFactory, MockTransportFactory, PeerTransportFactory, TcpTransportFactory, UdpTransportFactory, VMTransportFactory

public abstract class TransportFactory
extends Object


Constructor Summary
TransportFactory()
           
 
Method Summary
static TransportServer bind(BrokerService brokerService, URI location)
           
static TransportServer bind(URI location)
           
 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.
static Transport compositeConnect(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 Transport compositeConnect(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.
 Transport 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 Transport connect(URI location)
          Creates a normal transport.
static Transport connect(URI location, Executor ex)
          Creates a normal transport.
protected  Transport createTransport(URI location, WireFormat wf)
          Factory method to create a new transport
protected  WireFormat createWireFormat(Map<String,String> options)
           
protected  WireFormatFactory createWireFormatFactory(Map<String,String> options)
           
abstract  TransportServer doBind(URI location)
           
 Transport doCompositeConnect(URI location)
           
 Transport doCompositeConnect(URI location, Executor ex)
           
 Transport doConnect(URI location)
           
 Transport doConnect(URI location, Executor ex)
           
protected  String getDefaultWireFormatType()
           
protected  String getOption(Map options, String key, String def)
           
static void registerTransportFactory(String scheme, TransportFactory tf)
          Allow registration of a transport factory without wiring via META-INF classes
 Transport serverConfigure(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransportFactory

public TransportFactory()
Method Detail

doBind

public abstract TransportServer doBind(URI location)
                                throws IOException
Throws:
IOException

doConnect

public Transport doConnect(URI location,
                           Executor ex)
                    throws Exception
Throws:
Exception

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

bind

public static TransportServer bind(BrokerService brokerService,
                                   URI location)
                            throws IOException
Throws:
IOException

doConnect

public Transport doConnect(URI location)
                    throws Exception
Throws:
Exception

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

Throws:
IOException
UnknownHostException
MalformedURLException

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:

getOption

protected String getOption(Map options,
                           String key,
                           String def)


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.