toolbox.dao
Class ConnectionManagerDataSourceImpl

Package class diagram package ConnectionManagerDataSourceImpl
java.lang.Object
  extended by toolbox.dao.ConnectionManagerDataSourceImpl
All Implemented Interfaces:
ConnectionManager

public class ConnectionManagerDataSourceImpl
extends java.lang.Object
implements ConnectionManager

Abstracts the mechanism of obtaining managed connections from a javax.sql.DataSource instance.


Constructor Summary
ConnectionManagerDataSourceImpl()
          Default constructor
 
Method Summary
 void destroy()
          Perform cleanup operations.
 java.sql.Connection getConnection()
          Returns a reference to a pooled connection.
 void init(XMLProperties xmlProps)
          Initialise the connection manager with the given XMLProperties.
 void releaseConnection(java.sql.Connection connection)
          Release a connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionManagerDataSourceImpl

public ConnectionManagerDataSourceImpl()
Default constructor

Method Detail

init

public void init(XMLProperties xmlProps)
          throws DaoException
Initialise the connection manager with the given XMLProperties.

Lookup a DataSource instance.

Specified by:
init in interface ConnectionManager
Parameters:
xmlProps - XML configuration properties
Throws:
DaoException - if the manager cannot be initialised.

getConnection

public java.sql.Connection getConnection()
                                  throws DaoException
Returns a reference to a pooled connection.

Specified by:
getConnection in interface ConnectionManager
Returns:
A managed connection.
Throws:
DaoException - if a connection cannot be obtained.

releaseConnection

public void releaseConnection(java.sql.Connection connection)
Release a connection.

Specified by:
releaseConnection in interface ConnectionManager
Parameters:
connection - Connection to release

destroy

public void destroy()
             throws DaoException
Perform cleanup operations.

Specified by:
destroy in interface ConnectionManager
Throws:
DaoException - if the manager cannot be destroyed.