org.osesb.objectpools
Class ObjectPoolFactory

java.lang.Object
  extended by org.osesb.objectpools.ObjectPoolFactory
Direct Known Subclasses:
DOMPoolFactory, MessageRouterPoolFactory, SAXPoolFactory, ThreadPoolFactory

public abstract class ObjectPoolFactory
extends java.lang.Object

This Class is the ancestor for factory classes that manage homogeneous object pools, which are pools of objects that are all of the same type.

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

Example concrete implementations of ObjectPoolFactory are:

Since:
Version .9

Field Summary
protected static org.apache.commons.logging.Log log
          The logging implementation for this class.
 
Constructor Summary
ObjectPoolFactory()
           
 
Method Summary
abstract  ObjectPool getPool()
          Returns the object pool instance.
protected static org.apache.commons.pool.impl.GenericObjectPool.Config getPoolConfig(ObjectPoolConfiguration objectPoolConfiguration)
          Returns the pool configuration properties from objectPoolConfiguration, and instantiates org.apache.commons.pool.impl.GenericObjectPool.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

ObjectPoolFactory

public ObjectPoolFactory()
Method Detail

getPool

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

Returns:
an instance of a homogeneous object pool.
Throws:
java.lang.Exception - if there are problems with the pool or JAXP configurations or if there is a problem instantiating an object pool.

resetPoolInstance

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


getPoolConfig

protected static org.apache.commons.pool.impl.GenericObjectPool.Config getPoolConfig(ObjectPoolConfiguration objectPoolConfiguration)
                                                                              throws java.lang.Exception
Returns the pool configuration properties from objectPoolConfiguration, and instantiates org.apache.commons.pool.impl.GenericObjectPool.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