org.sapia.ubik.rmi.server.transport.nio.tcp
Class NioTcpTransportProvider

java.lang.Object
  extended by org.sapia.ubik.rmi.server.transport.nio.tcp.NioTcpTransportProvider
All Implemented Interfaces:
TransportProvider

public class NioTcpTransportProvider
extends java.lang.Object
implements TransportProvider

This transport provider is implemented on top of the Mina framework.

It internally creates NioServer instances. Various configuration properties are "understood" by this provider (see the doc for the corresponding constants further below). In addition, this provider interprets the ubik.rmi.server.max-threads property as indicating the number of processor threads that should be created by a NioServer instance (see NioServer.NioServer(InetSocketAddress, int, int)).

Author:
Yanick Duchesne
See Also:
Consts.SERVER_MAX_THREADS

Field Summary
static java.lang.String BIND_ADDRESS
          This constant corresponds to the ubik.rmi.transport.nio-tcp.bind-address system property.
static java.lang.String BUFFER_SIZE
          This constant corresponds to the ubik.rmi.transport.nio-tcp.buffer-size system property.
static int DEFAULT_BUFFER_SIZE
          The default buffer size (4000).
static java.lang.String PORT
          This constant corresponds to the ubik.rmi.transport.nio-tcp.port system property.
static java.lang.String TRANSPORT_TYPE
          Constant corresponding to this provider class' transport type.
 
Constructor Summary
NioTcpTransportProvider()
           
 
Method Summary
 Connections getPoolFor(ServerAddress address)
          Returns a client connection pool to the given server address.
 java.lang.String getTransportType()
          Returns this instance's "transport type".
 Server newDefaultServer()
          This method is called by Ubik RMI's runtime when a server is needed on the client side to recieve asynchronous responses (i.e.: callbacks).
 Server newServer(java.util.Properties props)
          Returns a server implementation.
 void shutdown()
          Shuts down this provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSPORT_TYPE

public static final java.lang.String TRANSPORT_TYPE
Constant corresponding to this provider class' transport type.

See Also:
Constant Field Values

BIND_ADDRESS

public static final java.lang.String BIND_ADDRESS
This constant corresponds to the ubik.rmi.transport.nio-tcp.bind-address system property.

See Also:
Constant Field Values

PORT

public static final java.lang.String PORT
This constant corresponds to the ubik.rmi.transport.nio-tcp.port system property.

See Also:
Constant Field Values

BUFFER_SIZE

public static final java.lang.String BUFFER_SIZE
This constant corresponds to the ubik.rmi.transport.nio-tcp.buffer-size system property.

See Also:
Constant Field Values

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
The default buffer size (4000).

See Also:
BUFFER_SIZE, Constant Field Values
Constructor Detail

NioTcpTransportProvider

public NioTcpTransportProvider()
Method Detail

getPoolFor

public Connections getPoolFor(ServerAddress address)
                       throws java.rmi.RemoteException
Description copied from interface: TransportProvider
Returns a client connection pool to the given server address.

Specified by:
getPoolFor in interface TransportProvider
Parameters:
address - a ServerAddress.
Returns:
a Connection.
Throws:
java.rmi.RemoteException - if a problem occurs creating the connection.
See Also:
TransportProvider.getPoolFor(org.sapia.ubik.net.ServerAddress)

getTransportType

public java.lang.String getTransportType()
Description copied from interface: TransportProvider
Returns this instance's "transport type".

Specified by:
getTransportType in interface TransportProvider
Returns:
a transport type.
See Also:
TransportProvider.getTransportType()

newDefaultServer

public Server newDefaultServer()
                        throws java.rmi.RemoteException
Description copied from interface: TransportProvider
This method is called by Ubik RMI's runtime when a server is needed on the client side to recieve asynchronous responses (i.e.: callbacks). Implementations must in this case provide a "default" Server instance.

Specified by:
newDefaultServer in interface TransportProvider
Returns:
a Server.
Throws:
java.rmi.RemoteException
See Also:
TransportProvider.newDefaultServer()

newServer

public Server newServer(java.util.Properties props)
                 throws java.rmi.RemoteException
Description copied from interface: TransportProvider
Returns a server implementation.

Specified by:
newServer in interface TransportProvider
Parameters:
props - the Properties used to create the server.
Returns:
a Server instance.
Throws:
java.rmi.RemoteException
See Also:
TransportProvider.newServer(java.util.Properties)

shutdown

public void shutdown()
Description copied from interface: TransportProvider
Shuts down this provider.

Specified by:
shutdown in interface TransportProvider
See Also:
TransportProvider.shutdown()


Copyright © 2010 Sapia OSS. All Rights Reserved.