| java.lang.Object org.smartlib.pool.core.PoolManagerImpl
PoolManagerImpl | public class PoolManagerImpl implements PoolManager(Code) | | This class implements the PoolManager interface.The basic responsibility of
this class is to load the configuration file , and initialise the pools and
priovide a single point access to the pools.
author: Sachin Shekar Shetty version: 1.0, 02/08/01 |
Inner Class :public static class ThreadRunner implements Runnable | |
Constructor Summary | |
public | PoolManagerImpl(String fileName) This constructor intialises the SmartPoolClass , reads the
configuration from fileName and loads the PoolManger. | public | PoolManagerImpl(File file) This constructor intialises the SmartPoolClass , reads the
configuration from file and loads the PoolManger. |
PoolManagerImpl | public PoolManagerImpl(String fileName) throws ConnectionPoolException(Code) | | This constructor intialises the SmartPoolClass , reads the
configuration from fileName and loads the PoolManger.
Parameters: file - The absolute configuration file path. exception: ConnectionPoolException - if there is any problem initialising the pools |
PoolManagerImpl | public PoolManagerImpl(File file) throws ConnectionPoolException(Code) | | This constructor intialises the SmartPoolClass , reads the
configuration from file and loads the PoolManger.
Parameters: file - The configuration file. exception: ConnectionPoolException - if there is any problem initialising the pools |
addConnectionLeakListener | public void addConnectionLeakListener(String poolName, 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: poolName - Name of the pool. Parameters: cle - Class implementing ConnectionLeakListener interface. exception: ConnectionPoolException - if there is any problem adding ConnectionLeakListener. |
getConnection | public Connection getConnection() throws ConnectionPoolException(Code) | | This method returns a Connection from the default connection pool.
The owner of this pool is marked as N/A indicating unknown.
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 default pool exception: ConnectionPoolException - if there is any problem getting connection. |
getConnection | public Connection getConnection(String poolName) throws ConnectionPoolException(Code) | | This method returns a Connection from the pool poolName .
The owner of this pool is marked as N/A indicating unknown.
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: poolName - Name of the pool. Connection from the pool exception: ConnectionPoolException - if there is any problem getting connection. |
getConnection | public Connection getConnection(String poolName, String owner) throws ConnectionPoolException(Code) | | This method returns a Connection from the pool poolName .
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: poolName - Name of the pool. Parameters: owner - String identifying the owner. Connection from the pool exception: ConnectionPoolException - if there is any problem getting connection. |
removeConnectionLeakListener | public void removeConnectionLeakListener(String poolName, ConnectionLeakListener cle) throws ConnectionPoolException(Code) | | This method removes a connection leak listener.cle will
not get any further notifications.
Parameters: poolName - Name of the pool. Parameters: cle - Class implementing ConnectionLeakListener interface. exception: ConnectionPoolException - if there is any problem removing ConnectionLeakListener. |
shutDown | public void shutDown()(Code) | | This method shuts down the pool, that is closes all connections to the database,
the pool can no longer be used unless reinitialised using a new SmartPoolFactory instance.
|
|
|