|
JThreadKitTM v1.1.0 ( public members only)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Classes implement this interface to work with some of the implementations
of ResourcePool. A resource pool will call back on the methods
of this inferface at various times. The ResourceManager
is usually specified at the time of construction of a resource pool.
Whenever another resource needs to be allocated, createResource() is called (typically when the pool's idle level is
below the low water mark - see ResourcePool) and the new
resource returned is added to the idle pool.
When a previously allocated resource is no longer needed, destroyResource is called after that resource has
been permanently removed from the pool.
Occasionally, some implementations will want to see if a resource in
the pool is still in a valid state. To do this, the pool will call the
healthCheck method to have the resource validated.
GenericResourcePool,
ResourcePool| Method Summary | |
Object |
createResource()
Called when a new resource is needed for the pool. |
void |
destroyResource(Object obj)
Called when a resource has been permanently removed from the pool. |
boolean |
healthCheck(Object obj)
Called when the pool wants to validate that the specified resource is still in a valid state. |
| Method Detail |
public Object createResource()
public void destroyResource(Object obj)
obj - the resource that should be deallocated, closed, or
whatever is necessary to properly release the resource.public boolean healthCheck(Object obj)
obj - the resource to validatetrue if the passed resource is still valid,
false if the resource is invalid or corrupt and should
be permanently removed from the pool.
|
JThreadKitTM v1.1.0 ( public members only)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||