public class TransportFactory
extends java.lang.Object
Constructor and Description |
---|
TransportFactory() |
Modifier and Type | Method and Description |
---|---|
static Transport |
createTransport(java.lang.String name,
Protocol messageType,
java.util.Properties props)
Creates a
Transport using the parameters provided. |
static void |
register(java.lang.String name,
java.lang.String className)
Registers a new
Transport and URI prefix with the AMPS Client. |
static void |
reset()
Resets self to the default state, unregistering any
Transport s registered at runtime. |
static void |
unregister(java.lang.String name)
Unregisters a
Transport from the AMPS client. |
public static void register(java.lang.String name, java.lang.String className) throws TransportTypeException
Transport
and URI prefix with the AMPS Client.name
- The URI prefix to register for this transport.className
- The name of the Java class to instantiate.TransportTypeException
- Thrown when this transport type is already registered.public static void unregister(java.lang.String name) throws TransportTypeException
Transport
from the AMPS client.
Note: built-in transport types (e.g. 'tcp') cannot be unregistered.name
- The URI prefix to unregister.TransportTypeException
- Thrown when this transport type has not been registered.public static void reset()
Transport
s registered at runtime.public static Transport createTransport(java.lang.String name, Protocol messageType, java.util.Properties props) throws TransportTypeException
Transport
using the parameters provided.name
- A string which contains the name of the future Transport.messageType
- A parameter of type Protocol which contains the classification of the message.props
- A parameter of type Properties which contains the information about the message to be created.Transport
.TransportTypeException
- Thrown when the requested transport type cannot be constructed.