org.osesb.objectpools
Class KeyedObjectPoolFactory

java.lang.Object
  extended by org.osesb.objectpools.KeyedObjectPoolFactory
Direct Known Subclasses:
ClientGatewayKeyedPoolFactory, JAXRPCClientKeyedPoolFactory, JMSClientKeyedPoolFactory, SAXKeyedPoolFactory, ValidationBeanKeyedPoolFactory

public abstract class KeyedObjectPoolFactory
extends java.lang.Object

This Class is the ancestor for factory classes that create heterogeneous object pools, which are pools of objects of different types.

The framework uses the Apache Pool Package (org.apache.commons.pool) to:

This class creates an instance of org.apache.commons.pool.impl.GenericKeyedObjectPool.Config for keyed object pools.

Example concrete implementations of KeyedObjectPoolFactory are:

Since:
Version .9

Field Summary
protected static org.apache.commons.logging.Log log
          The logging implementation for this class.
 
Constructor Summary
KeyedObjectPoolFactory()
           
 
Method Summary
abstract  KeyedObjectPoolConfiguration getKeyedObjectPoolConfiguration()
          Return the pool configuration as a whole including the ObjectPoolConfiguration and the pooled object configuration(s).
abstract  KeyedObjectPool getPool()
          Returns the object pool instance.
protected static org.apache.commons.pool.impl.GenericKeyedObjectPool.Config getPoolConfig(ObjectPoolConfiguration objectPoolConfiguration)
          Returns the pool configuration properties from objectPoolConfiguration, and instantiates org.apache.commons.pool.impl.GenericKeyedObjectPool.Config with those properties.
abstract  void resetPoolInstance()
          Close the pool and reset the poolInstance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
The logging implementation for this class.

Constructor Detail

KeyedObjectPoolFactory

public KeyedObjectPoolFactory()
Method Detail

getPool

public abstract KeyedObjectPool getPool()
                                 throws java.lang.Exception
Returns the object pool instance.

Returns:
an instance of a heterogeneous object pool.
Throws:
java.lang.Exception

getKeyedObjectPoolConfiguration

public abstract KeyedObjectPoolConfiguration getKeyedObjectPoolConfiguration()
Return the pool configuration as a whole including the ObjectPoolConfiguration and the pooled object configuration(s). Note that keyedObjectPoolConfiguration is null until getPool() is invoked on the concrete implementation of this class.


resetPoolInstance

public abstract void resetPoolInstance()
Close the pool and reset the poolInstance.


getPoolConfig

protected static org.apache.commons.pool.impl.GenericKeyedObjectPool.Config getPoolConfig(ObjectPoolConfiguration objectPoolConfiguration)
                                                                                   throws java.lang.Exception
Returns the pool configuration properties from objectPoolConfiguration, and instantiates org.apache.commons.pool.impl.GenericKeyedObjectPool.Config with those properties. Properties that are not configured are left at their defaults.

Parameters:
objectPoolConfiguration - The pool configuration, which contains configuration properties for the Apache pool.
Returns:
a pool configuration bean.
Throws:
java.lang.Exception