com.ibm.etill.framework.io
Class SocketConnections

java.lang.Object
  |
  +--com.ibm.etill.framework.io.SocketConnections

public final class SocketConnections
extends Object

Class used to maintain and terminate socket connections and cannot be subclasssed.

See Also:

Constructor Summary
SocketConnections()
           
 
Method Summary
static void closeConnection()
          Closes a Socket connection and throws ETillFrameworkException if a IOException is encountered.
static ETillConnection getConnection()
          Accesses a Socket connection from the pool of connections.
static void initializeConnection()
          Initializes the pool of Socket connections.
static void releaseConnection()
          Returns a Socket connection to the pool of connections.
static void setComPoint(ComPoint cp)
          Sets the Socket connection pool size.
static void setMaxSocketConnections(int max)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketConnections

public SocketConnections()
Method Detail

setComPoint

public static void setComPoint(ComPoint cp)
                        throws IOException
Sets the Socket connection pool size. Must be called before the initializePool method to be effective.
Parameters:
an - int that contains the connection pool size

setMaxSocketConnections

public static void setMaxSocketConnections(int max)

initializeConnection

public static void initializeConnection()
                                 throws IOException
Initializes the pool of Socket connections. Throws IOException if any errors occur.
Throws:
IOException - is thrown if a Socket error occurs.

getConnection

public static ETillConnection getConnection()
                                     throws IOException
Accesses a Socket connection from the pool of connections.
Returns:
a Connection object.
Throws:
IOException - is thrown if a Socket error occurs.

releaseConnection

public static void releaseConnection()
Returns a Socket connection to the pool of connections.

closeConnection

public static void closeConnection()
Closes a Socket connection and throws ETillFrameworkException if a IOException is encountered.
Throws:
ETillFrameworkException - is thrown if a IOException is caught.