|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface defining life-cycle methods for
instances to be used in an
ObjectPool
.
By contract, when an ObjectPool
delegates to a PoolableObjectFactory,
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.
ObjectPool
Method Summary | |
void |
activateObject(Object obj)
Reinitialize an instance to be returned by the pool. |
void |
destroyObject(Object obj)
Destroys an instance no longer needed by the pool. |
Object |
makeObject()
Creates an instance that can be returned by the pool. |
void |
passivateObject(Object obj)
Uninitialize an instance to be returned to the pool. |
boolean |
validateObject(Object obj)
Ensures that the instance is safe to be returned by the pool. |
Method Detail |
public void activateObject(Object obj) throws Exception
obj
- the instance to be activated
Exception
public void destroyObject(Object obj) throws Exception
obj
- the instance to be destroyed
Exception
public Object makeObject() throws Exception
Exception
public void passivateObject(Object obj) throws Exception
obj
- the instance to be passivated
Exception
public boolean validateObject(Object obj)
obj
- the instance to be validated
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |