toolbox.socket
Class SocketConnectionManagerPoolImpl

Package class diagram package SocketConnectionManagerPoolImpl
java.lang.Object
  extended by toolbox.socket.SocketConnectionManagerPoolImpl
All Implemented Interfaces:
SocketConnectionManager

public class SocketConnectionManagerPoolImpl
extends java.lang.Object
implements SocketConnectionManager

A SocketConnectionManager implementation that employs a resource pool to manage client socket connections.


Constructor Summary
SocketConnectionManagerPoolImpl()
          Default constructor.
 
Method Summary
 void destroy()
          Destroy this connection manager.
 java.net.Socket getSocket()
          Return a reference to a socket connection.
 void init(XMLProperties xmlProps)
          Initialise the connection manager with the given XMLProperties.
 void releaseSocket(java.net.Socket socket)
          Release a reference to a socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketConnectionManagerPoolImpl

public SocketConnectionManagerPoolImpl()
Default constructor.

Method Detail

init

public void init(XMLProperties xmlProps)
          throws SocketClientException
Initialise the connection manager with the given XMLProperties.

This implementation employs a SocketResourcePool instance to manage socket connections.

Specified by:
init in interface SocketConnectionManager
Parameters:
xmlProps - XML configuration properties
Throws:
SocketClientException - if the manager cannot be initialised.

getSocket

public java.net.Socket getSocket()
                          throws SocketClientException
Return a reference to a socket connection.

Specified by:
getSocket in interface SocketConnectionManager
Returns:
Socket instance
Throws:
SocketClientException

releaseSocket

public void releaseSocket(java.net.Socket socket)
Release a reference to a socket.

Specified by:
releaseSocket in interface SocketConnectionManager
Parameters:
socket - The socket instance to release.

destroy

public void destroy()
Destroy this connection manager.

Specified by:
destroy in interface SocketConnectionManager