Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.pool
Interface KeyedPoolableObjectFactory  view KeyedPoolableObjectFactory download KeyedPoolableObjectFactory.java

All Known Implementing Classes:
BaseKeyedPoolableObjectFactory

public interface KeyedPoolableObjectFactory

An interface defining life-cycle methods for instances to be served by a KeyedObjectPool.

By contract, when an KeyedObjectPool delegates to a KeyedPoolableObjectFactory,

  1. makeObject 55 is called whenever a new instance is needed.
  2. activateObject 55 is invoked on every instance before it is returned from the pool.
  3. passivateObject 55 is invoked on every instance when it is returned to the pool.
  4. destroyObject 55 is invoked on every instance when it is being "dropped" from the pool (whether due to the response from validateObject 55 , or for reasons specific to the pool implementation.)
  5. validateObject 55 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 "activated" 55 instance.

Version:
$Revision: 1.8 $ $Date: 2004/02/28 12:16:21 $

Method Summary
 void activateObject(java.lang.Object key, java.lang.Object obj)
          Reinitialize an instance to be returned by the pool.
 void destroyObject(java.lang.Object key, java.lang.Object obj)
          Destroy an instance no longer needed by the pool.
 java.lang.Object makeObject(java.lang.Object key)
          Create an instance that can be served by the pool.
 void passivateObject(java.lang.Object key, java.lang.Object obj)
          Uninitialize an instance to be returned to the pool.
 boolean validateObject(java.lang.Object key, java.lang.Object obj)
          Ensures that the instance is safe to be returned by the pool.
 

Method Detail

makeObject

public java.lang.Object makeObject(java.lang.Object key)
                            throws java.lang.Exception
Create an instance that can be served by the pool.


destroyObject

public void destroyObject(java.lang.Object key,
                          java.lang.Object obj)
                   throws java.lang.Exception
Destroy an instance no longer needed by the pool.


validateObject

public boolean validateObject(java.lang.Object key,
                              java.lang.Object obj)
Ensures that the instance is safe to be returned by the pool. Returns false if this instance should be destroyed.


activateObject

public void activateObject(java.lang.Object key,
                           java.lang.Object obj)
                    throws java.lang.Exception
Reinitialize an instance to be returned by the pool.


passivateObject

public void passivateObject(java.lang.Object key,
                            java.lang.Object obj)
                     throws java.lang.Exception
Uninitialize an instance to be returned to the pool.