org.sapia.ubik.rmi.server.transport.socket
Class SocketClientConnectionPool

java.lang.Object
  extended by org.sapia.ubik.rmi.server.transport.socket.SocketClientConnectionPool
All Implemented Interfaces:
Connections

public class SocketClientConnectionPool
extends java.lang.Object
implements Connections

Implements a pool of client-side SocketConnection instances. It multiplexes the pooled connections among multiple callers - thereby sparing the creation of multiple connections, and releiving the server of intensive threading - typically, one connection corresponds to one server thread.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Constructor Summary
SocketClientConnectionPool(java.lang.String host, int port, long resetInterval, java.rmi.server.RMIClientSocketFactory socketFactory)
          Constructor for RMIClientConnectionPool.
 
Method Summary
 RmiConnection acquire()
          Acquires a connection from this pool.
 void clear()
          Closes all connections kept internally and removes them.
 java.lang.String getTransportType()
          Returns the "transport type" of the connections held by this instance.
 void release(Connection conn)
          Releases the given connection to this pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketClientConnectionPool

public SocketClientConnectionPool(java.lang.String host,
                                  int port,
                                  long resetInterval,
                                  java.rmi.server.RMIClientSocketFactory socketFactory)
Constructor for RMIClientConnectionPool.

Parameters:
host - the host of the server to connect to.
port - the port of the server.
Method Detail

acquire

public RmiConnection acquire()
                      throws java.rmi.RemoteException
Description copied from interface: Connections
Acquires a connection from this pool.

Specified by:
acquire in interface Connections
Returns:
a Connection.
Throws:
java.rmi.RemoteException - if a problem occurs acquiring a connection.
See Also:
Connections.acquire()

release

public void release(Connection conn)
Description copied from interface: Connections
Releases the given connection to this pool.

Specified by:
release in interface Connections
See Also:
Connections.release(Connection)

clear

public void clear()
Description copied from interface: Connections
Closes all connections kept internally and removes them.

Specified by:
clear in interface Connections
See Also:
Connections.clear()

getTransportType

public java.lang.String getTransportType()
Description copied from interface: Connections
Returns the "transport type" of the connections held by this instance.

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


Copyright © 2010 Sapia OSS. All Rights Reserved.