|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.pooling.impl.BasicResourceContainer
public class BasicResourceContainer
The ResourceContainer is what is used by the pool
to contain and manage the number of Resources
that are made available.
Field Summary | |
---|---|
protected static java.lang.String |
LOG_CONTEXT
|
Constructor Summary | |
---|---|
BasicResourceContainer(long containerID)
|
Method Summary | |
---|---|
boolean |
checkin(Resource resource,
java.lang.String userName)
Returns the resource object request for the userName |
Resource |
checkOut(java.lang.String userName)
Returns the resource object request for the userName |
java.util.Properties |
getProperties()
Returns the resource 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. |
protected ResourcePool |
getResourcePool()
|
ResourceStatistics |
getStats()
Returns the statistics for this resource |
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()
This method is invoked by the pool when the resource will have all its resources cleaned up. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String LOG_CONTEXT
Constructor Detail |
---|
public BasicResourceContainer(long containerID)
Method Detail |
---|
public void init(ResourcePool resourcePool, java.lang.Object physicalResourceObject, int maxConcurrentUsers) throws ResourcePoolException
ResourceContainer
init
in interface ResourceContainer
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.public ResourceDescriptor getResourceDescriptor()
getResourceDescriptor
in interface ResourceContainer
public java.util.Properties getProperties()
getProperties
in interface ResourceContainer
public boolean hasAvailableResource()
ResourceContainer
true
if one or more rescources are
available for checkout in the specific container instance.
hasAvailableResource
in interface ResourceContainer
public boolean isAlive() throws ResourcePoolException
ResourceContainer
true
if the physical resource
is alive.
isAlive
in interface ResourceContainer
ResourcePoolException
- is an error ocurrs when checking the
state of the physical resourcepublic Resource checkOut(java.lang.String userName) throws ResourcePoolException
checkOut
in interface ResourceContainer
ResourcePoolException
public boolean checkin(Resource resource, java.lang.String userName) throws ResourcePoolException
checkin
in interface ResourceContainer
ResourcePoolException
- is an error ocurrs when checking in resourcepublic java.lang.Object getResourceObject()
ResourceContainer
getResourceObject
in interface ResourceContainer
public final void shutDown() throws ResourcePoolException
isAlive()
should return false
.
shutDown
in interface ResourceContainer
ResourcePoolException
public ResourceStatistics getStats()
getStats
in interface ResourceContainer
protected ResourcePool getResourcePool()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |