org.apache.commons.pool
Interface KeyedPoolableObjectFactory
public
interface
KeyedPoolableObjectFactory
An interface defining life-cycle methods for
instances to be served by a
{@link KeyedObjectPool KeyedObjectPool}.
By contract, when an {@link KeyedObjectPool KeyedObjectPool}
delegates to a KeyedPoolableObjectFactory,
-
{@link #makeObject makeObject}
is called whenever a new instance is needed.
-
{@link #activateObject activateObject}
is invoked on every instance before it is returned from the
pool.
-
{@link #passivateObject passivateObject}
is invoked on every instance when it is returned to the
pool.
-
{@link #destroyObject destroyObject}
is invoked on every instance when it is being "dropped" from the
pool (whether due to the response from
{@link #validateObject validateObject}, or
for reasons specific to the pool implementation.)
-
{@link #validateObject validateObject}
is invoked in an implementation-specific fashion to determine if an instance
is still valid to be returned by the pool.
It will only be invoked on an {@link #activateObject "activated"}
instance.
Version: $Revision: 155430 $ $Date: 2005-02-26 08:13:28 -0500 (Sat, 26 Feb 2005) $
Author: Rodney Waldhoff
See Also:
Method Summary |
void | activateObject(Object key, Object obj)
Reinitialize an instance to be returned by the pool. |
void | destroyObject(Object key, Object obj)
Destroy an instance no longer needed by the pool. |
Object | makeObject(Object key)
Create an instance that can be served by the pool. |
void | passivateObject(Object key, Object obj)
Uninitialize an instance to be returned to the pool. |
boolean | validateObject(Object key, Object obj)
Ensures that the instance is safe to be returned by the pool.
|
public void activateObject(Object key, Object obj)
Reinitialize an instance to be returned by the pool.
Parameters: key the key used when selecting the object obj the instance to be activated
public void destroyObject(Object key, Object obj)
Destroy an instance no longer needed by the pool.
Parameters: key the key used when selecting the instance obj the instance to be destroyed
public Object makeObject(Object key)
Create an instance that can be served by the pool.
Parameters: key the key used when constructing the object
Returns: an instance that can be served by the pool.
public void passivateObject(Object key, Object obj)
Uninitialize an instance to be returned to the pool.
Parameters: key the key used when selecting the object obj the instance to be passivated
public boolean validateObject(Object key, Object obj)
Ensures that the instance is safe to be returned by the pool.
Returns
false if this instance should be destroyed.
Parameters: key the key used when selecting the object obj the instance to be validated
Returns: false if this obj is not valid and should
be dropped from the pool, true otherwise.
Copyright © 2001-2003 Apache Software Foundation. Documenation generated August 12 2007.