com.crankuptheamps.client
Class TransportFactory

java.lang.Object
  extended by com.crankuptheamps.client.TransportFactory

public class TransportFactory
extends Object


Constructor Summary
TransportFactory()
           
 
Method Summary
static Transport createTransport(String name, Protocol messageType, Properties props)
           
static void register(String name, String className)
          Registers a new Transport and URI prefix with the AMPS Client.
static void reset()
          Resets self to the default state, unregistering any Transports registered at runtime.
static void unregister(String name)
          Unregisters a Transport from the AMPS client.
 
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

register

public static void register(String name,
                            String className)
                     throws TransportTypeException
Registers a new Transport and URI prefix with the AMPS Client.

Parameters:
name - The URI prefix to register for this transport.
className - The name of the Java class to instantiate.
Throws:
TransportTypeException - Thrown when this transport type is already registered.

unregister

public static void unregister(String name)
                       throws TransportTypeException
Unregisters a Transport from the AMPS client. Note: built-in transport types (e.g. `tcp') cannot be unregistered.

Parameters:
name - The URI prefix to unregister.
Throws:
TransportTypeException - Thrown when this transport type has not been registered.

reset

public static void reset()
Resets self to the default state, unregistering any Transports registered at runtime.


createTransport

public static Transport createTransport(String name,
                                        Protocol messageType,
                                        Properties props)
                                 throws TransportTypeException
Throws:
TransportTypeException