com.softwareag.um.io.TransportFactory Class Reference

The TransportFactory is used to to create ServerTransports or client Transports. More...

Static Public Member Functions

static AsynchronousServerTransport bind (ServerTransportContext context, AcceptHandler ahandler, DataHandler dHandler, CloseHandler cHandler) throws IOException
 Bind a new ServerTransport as defined by the context. More...
 
static SynchronousServerTransport bind (ServerTransportContext context) throws IOException
 Create a new SynchronousServerTransport using the configuration stored in the ServerTransportContext. More...
 
static AsynchronousTransport connect (ClientTransportContext context, ConnectHandler connectHandler, DataHandler dataHandler, CloseHandler closeHandler) throws IOException
 Connect to a ServerTransport using the configuration defined in the ClientTransportContext. More...
 
static SynchronousTransport connect (ClientTransportContext context) throws IOException
 Connect a new SynchronousTransport as defined in the context to a server. More...
 
static boolean TransportSupported (String transportName)
 This function tests to see if the requested transport is supported on the current hardware. More...
 

Detailed Description

The TransportFactory is used to to create ServerTransports or client Transports.

To bind a server Transport you need to first create a ServerTransportContext or to connect to an existing server you need to create a ClientTransportContext.

See Also
com.softwareag.um.io.ClientTransportContext
com.softwareag.um.io.ServerTransportContext

Member Function Documentation

static AsynchronousServerTransport com.softwareag.um.io.TransportFactory.bind ( ServerTransportContext  context,
AcceptHandler  ahandler,
DataHandler  dHandler,
CloseHandler  cHandler 
) throws IOException
static

Bind a new ServerTransport as defined by the context.

This method takes several callback objects which will be notified asynchronously when certain events occur.

Parameters
contextThe ServerTransportContext which defines what type of ServerTransport to create
ahandlerThe AcceptHandler that will be notified when new client Transports connect
dHandlerThe DataHandler that will be notified when data is available to be read from an AsynchronousTranport
cHandlerThe CloseHandler that will be notified when a client Transport is closed
Returns
AsynchronousServerTransport that will asynchronously accept client connections
Exceptions
IOExceptionif the ServerTransport cannot be bound using the configuration in the context
static SynchronousServerTransport com.softwareag.um.io.TransportFactory.bind ( ServerTransportContext  context) throws IOException
static

Create a new SynchronousServerTransport using the configuration stored in the ServerTransportContext.

This ServerTransport can be used to accept connections.

Parameters
contextthe configuration to use to create the ServerTransport
Returns
the SynchronousServerTransport that can be used to accept new client connections
Exceptions
IOExceptionif the ServerTransport as defined in the context cannot be bound to
static AsynchronousTransport com.softwareag.um.io.TransportFactory.connect ( ClientTransportContext  context,
ConnectHandler  connectHandler,
DataHandler  dataHandler,
CloseHandler  closeHandler 
) throws IOException
static

Connect to a ServerTransport using the configuration defined in the ClientTransportContext.

Parameters
contextcontains the configuration required to connect to the ServerTransport
connectHandlernotified when the AsynchronousTransport is connected
dataHandlernotified when data is available to be read from the AsynchronousTransport
closeHandlernotified when the AsynchronousTransport is closed
Returns
AsynchronousTransport that can be written to and will fire callbacks when data is available to be read
Exceptions
IOExceptionif there is a problem connecting to the ServerTransport
static SynchronousTransport com.softwareag.um.io.TransportFactory.connect ( ClientTransportContext  context) throws IOException
static

Connect a new SynchronousTransport as defined in the context to a server.

Parameters
contextdefines the configuration fo the SynchronousTransport
Returns
SynchronousTransport that can be used to read/write data to the server
Exceptions
IOExceptionif the SynchronousTransport as defined in the context cannot connect to the server
static boolean com.softwareag.um.io.TransportFactory.TransportSupported ( String  transportName)
static

This function tests to see if the requested transport is supported on the current hardware.

Transports like RDMA require specialised Infiniband cards and drivers to be present.

Parameters
transportNameto test
Returns
true or false, depending if the transport is supported