|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceContainer
The ResourceContainer represents one instance of a physical resource in the pool. For each physical resource created for the pool, a new container instance will be created to hold and manage the physical instance. Each container instance will manage the statistics related to that instance. This would include how many users are currently using this instance and who are they.
Method Summary | |
---|---|
boolean |
checkin(Resource resource,
java.lang.String userName)
Called to checkin the |
Resource |
checkOut(java.lang.String userName)
Returns the resource object request for the userName |
java.util.Properties |
getProperties()
Returns the properties |
ResourceDescriptor |
getResourceDescriptor()
Returns the resource descriptor that describes this resource |
java.lang.Object |
getResourceObject()
Returns the physical resource object Do not call this method to checkout the resource. |
ResourceStatistics |
getStats()
Returns the statistics for this container |
boolean |
hasAvailableResource()
Returns true if one or more rescources are
available for checkout in the specific container instance. |
void |
init(ResourcePool resourcePool,
java.lang.Object physicalResourceObject,
int maxConcurrentUsers)
This method is invoked by the pool to set a reference of itself on the resource |
boolean |
isAlive()
Return true if the physical resource
is alive. |
void |
shutDown()
Called to shutdown the container and cleanup resource references. |
Method Detail |
---|
void init(ResourcePool resourcePool, java.lang.Object physicalResourceObject, int maxConcurrentUsers) throws ResourcePoolException
resourcePool
- is the resource pool from which the resource is managed.physicalResourceObject
- is the physical object to be managed by the containermaxConcurrentUsers
- indicates the maximum number of users that can share
the physicalResourceObject
ResourcePoolException
- if an error occurs initializing resource.ResourceDescriptor getResourceDescriptor()
java.util.Properties getProperties()
boolean isAlive() throws ResourcePoolException
true
if the physical resource
is alive.
ResourcePoolException
- is an error ocurrs when checking the
state of the physical resourceboolean hasAvailableResource()
true
if one or more rescources are
available for checkout in the specific container instance.
Resource checkOut(java.lang.String userName) throws ResourcePoolException
ResourcePoolException
boolean checkin(Resource resource, java.lang.String userName) throws ResourcePoolException
true
if the resource was checked in
ResourcePoolException
- is an error ocurrs when checking in resourcejava.lang.Object getResourceObject()
ResourceStatistics getStats()
void shutDown() throws ResourcePoolException
Resource
ResourcePoolException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |