|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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,
makeObject
is called whenever a new instance is needed.
activateObject
is invoked on every instance before it is returned from the
pool.
passivateObject
is invoked on every instance when it is returned to the
pool.
destroyObject
is invoked on every instance when it is being "dropped" from the
pool (whether due to the response from
validateObject
, or
for reasons specific to the pool implementation.)
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 "activated"
instance.
KeyedObjectPool
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 |
---|
void activateObject(java.lang.Object key, java.lang.Object obj) throws java.lang.Exception
key
- the key used when selecting the objectobj
- the instance to be activated
java.lang.Exception
void destroyObject(java.lang.Object key, java.lang.Object obj) throws java.lang.Exception
key
- the key used when selecting the instanceobj
- the instance to be destroyed
java.lang.Exception
java.lang.Object makeObject(java.lang.Object key) throws java.lang.Exception
key
- the key used when constructing the object
java.lang.Exception
void passivateObject(java.lang.Object key, java.lang.Object obj) throws java.lang.Exception
key
- the key used when selecting the objectobj
- the instance to be passivated
java.lang.Exception
boolean validateObject(java.lang.Object key, java.lang.Object obj)
key
- the key used when selecting the objectobj
- the instance to be validated
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |