org.apache.commons.pool
Class BasePoolableObjectFactory

java.lang.Object
  extended by org.apache.commons.pool.BasePoolableObjectFactory
All Implemented Interfaces:
PoolableObjectFactory

public abstract class BasePoolableObjectFactory
extends java.lang.Object
implements PoolableObjectFactory

A base implementation of PoolableObjectFactory.

All operations defined here are essentially no-op's.

Since:
Pool 1.0
Version:
$Revision: 965336 $ $Date: 2010-07-18 20:58:33 -0400 (Sun, 18 Jul 2010) $
Author:
Rodney Waldhoff
See Also:
PoolableObjectFactory, BaseKeyedPoolableObjectFactory

Constructor Summary
BasePoolableObjectFactory()
           
 
Method Summary
 void activateObject(java.lang.Object obj)
          No-op.
 void destroyObject(java.lang.Object obj)
          No-op.
abstract  java.lang.Object makeObject()
          Creates an instance that can be served by the pool.
 void passivateObject(java.lang.Object obj)
          No-op.
 boolean validateObject(java.lang.Object obj)
          This implementation always returns true.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePoolableObjectFactory

public BasePoolableObjectFactory()
Method Detail

activateObject

public void activateObject(java.lang.Object obj)
                    throws java.lang.Exception
No-op.

Specified by:
activateObject in interface PoolableObjectFactory
Parameters:
obj - ignored
Throws:
java.lang.Exception - if there is a problem activating obj, this exception may be swallowed by the pool.
See Also:
PoolableObjectFactory.destroyObject(java.lang.Object)

destroyObject

public void destroyObject(java.lang.Object obj)
                   throws java.lang.Exception
No-op.

Specified by:
destroyObject in interface PoolableObjectFactory
Parameters:
obj - ignored
Throws:
java.lang.Exception - should be avoided as it may be swallowed by the pool implementation.
See Also:
PoolableObjectFactory.validateObject(java.lang.Object), ObjectPool.invalidateObject(java.lang.Object)

makeObject

public abstract java.lang.Object makeObject()
                                     throws java.lang.Exception
Creates an instance that can be served by the pool. Instances returned from this method should be in the same state as if they had been activated. They will not be activated before being served by the pool.

Specified by:
makeObject in interface PoolableObjectFactory
Returns:
an instance that can be served by the pool.
Throws:
java.lang.Exception - if there is a problem creating a new instance, this will be propagated to the code requesting an object.

passivateObject

public void passivateObject(java.lang.Object obj)
                     throws java.lang.Exception
No-op.

Specified by:
passivateObject in interface PoolableObjectFactory
Parameters:
obj - ignored
Throws:
java.lang.Exception - if there is a problem passivating obj, this exception may be swallowed by the pool.
See Also:
PoolableObjectFactory.destroyObject(java.lang.Object)

validateObject

public boolean validateObject(java.lang.Object obj)
This implementation always returns true.

Specified by:
validateObject in interface PoolableObjectFactory
Parameters:
obj - ignored
Returns:
true


Copyright © 2001-2003 Apache Software Foundation. Documenation generated November 29 2010.