org.osesb.objectpools
Class MessageRouterPoolFactory.MessageRouterPoolableObjectFactory

java.lang.Object
  extended by org.osesb.objectpools.MessageRouterPoolFactory.MessageRouterPoolableObjectFactory
All Implemented Interfaces:
org.apache.commons.pool.PoolableObjectFactory
Enclosing class:
MessageRouterPoolFactory

protected static class MessageRouterPoolFactory.MessageRouterPoolableObjectFactory
extends java.lang.Object
implements org.apache.commons.pool.PoolableObjectFactory

Inner class that implements org.apache.commons.pool.PoolableObjectFactory, which is instantiated by the enclosing class and passed to GenericObjectPool's constructor.


Field Summary
protected  java.lang.String thisClassName
          The full name of this class
 
Constructor Summary
MessageRouterPoolFactory.MessageRouterPoolableObjectFactory()
          Create a new instance of MessageRouterPoolableObjectFactory.
 
Method Summary
 void activateObject(java.lang.Object obj)
          Invoked on every object before it is returned FROM the pool.
 void destroyObject(java.lang.Object obj)
          Invoked on every object when it is being "dropped" from the pool.
 java.lang.Object makeObject()
          Called whenever a new instance of a pooled object is needed.
 void passivateObject(java.lang.Object obj)
          Invoked on every object before it is returned TO the pool.
 boolean validateObject(java.lang.Object obj)
          validateObject is invoked based on the settings of the 'testOnBorrow', 'testOnReturn', and 'testWhileIdle' configuration properties of the <pool-configuration> content model in the pool factory configuration file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thisClassName

protected java.lang.String thisClassName
The full name of this class

Constructor Detail

MessageRouterPoolFactory.MessageRouterPoolableObjectFactory

public MessageRouterPoolFactory.MessageRouterPoolableObjectFactory()
Create a new instance of MessageRouterPoolableObjectFactory.

Method Detail

makeObject

public java.lang.Object makeObject()
                            throws java.lang.Exception
Called whenever a new instance of a pooled object is needed.

Specified by:
makeObject in interface org.apache.commons.pool.PoolableObjectFactory
Throws:
java.lang.Exception

destroyObject

public void destroyObject(java.lang.Object obj)
Invoked on every object when it is being "dropped" from the pool.

Specified by:
destroyObject in interface org.apache.commons.pool.PoolableObjectFactory

validateObject

public boolean validateObject(java.lang.Object obj)
validateObject is invoked based on the settings of the 'testOnBorrow', 'testOnReturn', and 'testWhileIdle' configuration properties of the <pool-configuration> content model in the pool factory configuration file.

For example, if 'testOnBorrow' is true, then the apache pool implementation invokes this method when objects are borrowed from the pool.

Specified by:
validateObject in interface org.apache.commons.pool.PoolableObjectFactory

activateObject

public void activateObject(java.lang.Object obj)
Invoked on every object before it is returned FROM the pool.

Specified by:
activateObject in interface org.apache.commons.pool.PoolableObjectFactory

passivateObject

public void passivateObject(java.lang.Object obj)
Invoked on every object before it is returned TO the pool.

Specified by:
passivateObject in interface org.apache.commons.pool.PoolableObjectFactory