org.jboss.soa.esb.connection
Class DefaultConnectionPoolImpl

java.lang.Object
  extended by org.jboss.soa.esb.connection.DefaultConnectionPoolImpl
All Implemented Interfaces:
ConnectionPool

public class DefaultConnectionPoolImpl
extends java.lang.Object
implements ConnectionPool

Default connection pool implementation class when none is specified by the user in @link ConnectionProperties

Author:
MohitK Date: Jul 18, 2006

Constructor Summary
DefaultConnectionPoolImpl()
           
 
Method Summary
 void closeConnection(java.sql.Connection connectionToClose)
          This method closes an open connection and returns the connection to the pool.
 void createPool(ConnectionProperties prop)
          This method is used to create the connection pool and keep it ready
protected  void finalize()
           
 java.sql.Connection getConnection()
          This method is called whenever a connection is needed from the pool.
protected  void releaseAbandonedConnections()
          This method will release all abandoned connections from the pool.
 void releasePool()
          This method is called when the pool needs to be destroyed effectively closing all open connections
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConnectionPoolImpl

public DefaultConnectionPoolImpl()
Method Detail

createPool

public void createPool(ConnectionProperties prop)
                throws ConnectionException
Description copied from interface: ConnectionPool
This method is used to create the connection pool and keep it ready

Specified by:
createPool in interface ConnectionPool
Parameters:
prop - Properties for the connection pool including connection properties
Throws:
ConnectionException
See Also:
ConnectionPool.createPool(ConnectionProperties)

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Description copied from interface: ConnectionPool
This method is called whenever a connection is needed from the pool.

Specified by:
getConnection in interface ConnectionPool
Returns:
Connection to be used
Throws:
java.sql.SQLException
See Also:
ConnectionPool.getConnection()

closeConnection

public void closeConnection(java.sql.Connection connectionToClose)
Description copied from interface: ConnectionPool
This method closes an open connection and returns the connection to the pool.

Specified by:
closeConnection in interface ConnectionPool
Parameters:
connectionToClose - The connection to be returned to the pool.
See Also:
ConnectionPool;

releasePool

public void releasePool()
Description copied from interface: ConnectionPool
This method is called when the pool needs to be destroyed effectively closing all open connections

Specified by:
releasePool in interface ConnectionPool
See Also:
ConnectionPool.releasePool()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

releaseAbandonedConnections

protected void releaseAbandonedConnections()
This method will release all abandoned connections from the pool.