connectionpool
Interface PoolManager

All Known Implementing Classes:
PoolManagerImpl

public abstract interface PoolManager

This interface defines the behavior of the class that will manage various pools and provide a single access point to the pools.


Method Summary
 void addConnectionLeakListener(java.lang.String poolName, ConnectionLeakListener cle)
          This method adds a connection leak listener.The methods of cle will be called when a leak is detected as per the pool configuration.
 java.sql.Connection getConnection()
          This method returns a Connection from the default connection pool.
 java.sql.Connection getConnection(java.lang.String poolName)
          This method returns a Connection from the pool poolName.
 java.sql.Connection getConnection(java.lang.String poolName, java.lang.String owner)
          This method returns a Connection from the pool poolName.
 PoolMonitor getPoolMonitor(java.lang.String poolName)
          This method returns the instance of PoolMonitor for the pool poolName
 void removeConnectionLeakListener(java.lang.String poolName, ConnectionLeakListener cle)
          This method removes a connection leak listener.cle will not get any further notifications.
 

Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws ConnectionPoolException
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.
Returns:
Connection from the default pool
Throws:
ConnectionPoolException - if there is any problem getting connection.

getConnection

public java.sql.Connection getConnection(java.lang.String poolName)
                                  throws ConnectionPoolException
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.
Returns:
Connection from the pool
Throws:
ConnectionPoolException - if there is any problem getting connection.

getConnection

public java.sql.Connection getConnection(java.lang.String poolName,
                                         java.lang.String owner)
                                  throws ConnectionPoolException
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.
owner - String identifying the owner.
Returns:
Connection from the pool
Throws:
ConnectionPoolException - if there is any problem getting connection.

addConnectionLeakListener

public void addConnectionLeakListener(java.lang.String poolName,
                                      ConnectionLeakListener cle)
                               throws ConnectionPoolException
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.
cle - Class implementing ConnectionLeakListener interface.
Throws:
ConnectionPoolException - If there is any problem adding ConnectionLeakListener.

removeConnectionLeakListener

public void removeConnectionLeakListener(java.lang.String poolName,
                                         ConnectionLeakListener cle)
                                  throws ConnectionPoolException
This method removes a connection leak listener.cle will not get any further notifications.
Parameters:
poolName - Name of the pool.
cle - Class implementing ConnectionLeakListener interface.
Throws:
ConnectionPoolException - If there is any problem removing ConnectionLeakListener.

getPoolMonitor

public PoolMonitor getPoolMonitor(java.lang.String poolName)
                           throws ConnectionPoolException
This method returns the instance of PoolMonitor for the pool poolName
Parameters:
poolName - Name of the pool.
Returns:
PoolMonitor interface to monitor the state of the pool
Throws:
ConnectionPoolException -