|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Resource
The Resource is used as a wrapper for the physical resource object. This interface
dictates the behavior the resource pooling framework requires in order
to provide, share and manage resources in a pool. Therefore, any physical resource
must implement this interface in order to be managed in a resource pool.
The implementor should extend BaseResource
to create
a wrapper class for their specific business object. This wrapper will be
created when it is being checked out so that a reference can be kept to
the ResourceContainer
from which it came and also
track the user who currently has it checkedout.
Method Summary | |
---|---|
void |
closeResource()
This method should be invoked by user to indicate the use of the resource is not longer needed. |
java.lang.String |
getCheckedOutBy()
Returns the name of the user that has checked out this resource. |
void |
init(java.lang.String checkedOutBy)
Called by the adapter for the resource to initialize itself and validate it should be valid resource for use. |
boolean |
isResourceAlive()
isResourceAlive is called to determine if the resource is operating normally. |
Method Detail |
---|
void init(java.lang.String checkedOutBy) throws ResourcePoolException
checkedOutBy
- is the name of the user for which this resource
instance is being used
ResourcePoolException
- if not a valid resourcejava.lang.String getCheckedOutBy()
void closeResource() throws ResourcePoolException
ResourcePoolConnection
- if there is an error closing the resource
ResourcePoolException
boolean isResourceAlive() throws ResourcePoolException
false
indicates the resource should not be used.
If the resource is unusable, it will be shutdown and possibly another
instance will take its place.
ResourcePoolException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |