| |
|
| java.lang.Object org.smartlib.pool.core.ConnectionPool
ConnectionPool | public class ConnectionPool implements Pool,PoolMonitor(Code) | | This class implements the Pool interface and thus is responsible for
managing a single pool of connections.
|
addConnectionLeakListener | public void addConnectionLeakListener(ConnectionLeakListener cle) throws ConnectionPoolException(Code) | | This method adds a connection leak listener. The methods of
cle will be called when a leak is detected as per the
pool configuration.
Parameters: cle - Class implementing ConnectionLeakListener interface. exception: ConnectionPoolException - if there is any problemadding ConnectionLeakListener. |
getConfigMonitor | public ConfigMonitor getConfigMonitor()(Code) | | This method returns an instance of ConfigMonitor.
ConfigMonitor for monitoring the configuration of the pool atruntime. |
getConnection | public Connection getConnection() throws ConnectionPoolException(Code) | | This method returns a Connection from the connection pool.
The owner of this pool is marked as N/A indicating unknown/anonymous.
Note: This method blocks if the pool size has reached it's
maximum size and no free connections are available
until a free connection is available. The time period for which this
method blocks depends on the connection-wait-time-out specified in
the configuration file.
Connection from the pool. exception: ConnectionPoolException - if there is any problemgetting connection. |
getConnection | public Connection getConnection(String owner) throws ConnectionPoolException(Code) | | This method returns a Connection from the pool.
The owner of this connection is identified by owner .
Note: This method blocks if the pool size has reached it's
maximum size and no free connections are available
until a free connection is available. The time period for which this
method blocks depends on the connection-wait-time-out specified in
the configuration file.
Parameters: owner - String identifying the owner. Connection from the pool exception: ConnectionPoolException - if there is any problemgetting connection. |
getConnectionLeakListeners | public Vector getConnectionLeakListeners()(Code) | | Vector of registered ConnectionLeakListeners. |
getConnectionsInUse | public Vector getConnectionsInUse()(Code) | | Vector of connections in use. |
getCurrentPoolSize | public int getCurrentPoolSize()(Code) | | This method returns the current size of the pool.
Current size of the pool. |
getNoOfFreeConnections | public int getNoOfFreeConnections()(Code) | | Number of free connections in the pool. |
releaseConnections | public void releaseConnections()(Code) | | This method releases excessive connections, i.e it actully closes
them.
|
removeConnectionLeakListener | public void removeConnectionLeakListener(ConnectionLeakListener cle) throws ConnectionPoolException(Code) | | This method removes a connection leak listener. cle will
not get any further notifications.
Parameters: cle - Class implementing ConnectionLeakListener interface. exception: ConnectionPoolException - If there is any problemremoving ConnectionLeakListener. |
returnConnection | public void returnConnection(Connection ret)(Code) | | This method releases the connection back to the pool.
Parameters: ret - connection to be released |
shutDown | public void shutDown()(Code) | | |
|
|
|