toolbox.pooling
Class JDBCResourcePool

Package class diagram package JDBCResourcePool
java.lang.Object
  extended by toolbox.pooling.ResourcePoolImpl
      extended by toolbox.pooling.JDBCResourcePool
All Implemented Interfaces:
ResourcePool

public class JDBCResourcePool
extends ResourcePoolImpl

ResourcePool implementation to do JDBC connection pooling.


Field Summary
 
Fields inherited from class toolbox.pooling.ResourcePoolImpl
m_customProps
 
Constructor Summary
JDBCResourcePool()
          Default constructor
 
Method Summary
protected  java.lang.Object createResource(XMLProperties xmlProps, int count)
          Creates a JDBCConfig instance from the given XMLProperties and retrieves the Connection instance from the config instance.
protected  void destroyResource(java.lang.Object resource)
          Destroys the given Connection.
protected  boolean isResourceValid(java.lang.Object resource)
          Validates the given connection and returns the validation state.
protected  void preInit(XMLProperties xmlProps)
          Not implemented.
 
Methods inherited from class toolbox.pooling.ResourcePoolImpl
destroy, getName, getResource, getStatus, getStatusString, init, releaseResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCResourcePool

public JDBCResourcePool()
Default constructor

Method Detail

preInit

protected void preInit(XMLProperties xmlProps)
                throws ResourcePoolException
Not implemented.

Specified by:
preInit in class ResourcePoolImpl
Parameters:
xmlProps - XML configuration properties.
Throws:
ResourcePoolException - if the custom initialisation fails.

createResource

protected java.lang.Object createResource(XMLProperties xmlProps,
                                          int count)
                                   throws ResourcePoolException
Creates a JDBCConfig instance from the given XMLProperties and retrieves the Connection instance from the config instance.

Specified by:
createResource in class ResourcePoolImpl
Parameters:
xmlProps - XML configuration properties.
count - int indicating how many times this method has be called.
Returns:
Connection that was created.
Throws:
ResourcePoolException - if the JDBC connection cannot be created.

destroyResource

protected void destroyResource(java.lang.Object resource)
                        throws ResourcePoolException
Destroys the given Connection.

Specified by:
destroyResource in class ResourcePoolImpl
Parameters:
resource - Connection resource to destroy.
Throws:
ResourcePoolException - if the connection could not be closed.

isResourceValid

protected boolean isResourceValid(java.lang.Object resource)
                           throws ResourcePoolException
Validates the given connection and returns the validation state.

Specified by:
isResourceValid in class ResourcePoolImpl
Parameters:
resource - Data connection to validate.
Returns:
boolean indicating the state of the connection.
Throws:
ResourcePoolException