|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.pooling.impl.BasicResourcePool
public class BasicResourcePool
NOTE: Currently, the pool does not use the ConcurrentUser option The moving of a container from the resourcepool to the inuseresourcepool is done when a resource is checkedout and backin The logic doesn't consider the concurrent user option History: Who When Why ================================================================= V.Halbert 5/15/03 remove the isAlive checking due to db overhead just let the cleanup thread perform the isAlive cleanup
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.metamatrix.common.pooling.api.ResourcePool |
---|
ResourcePool.Defaults |
Field Summary | |
---|---|
protected static java.lang.String |
CONTEXT
|
protected ResourceDescriptor |
resourceDescriptor
|
Fields inherited from interface com.metamatrix.common.pooling.api.ResourcePool |
---|
JDBC_SHARED_CONNECTION_POOL, RESOURCE_POOL |
Constructor Summary | |
---|---|
BasicResourcePool()
|
Method Summary | |
---|---|
void |
checkIn(ResourceContainer resourceContainer,
java.lang.String userName)
Called by the resource container to checkin itself to the pool. |
Resource |
checkOut(java.lang.String userName)
Returns a resource from the pool. |
protected Resource |
checkResourceCache()
|
void |
cleanUp()
|
protected void |
finalize()
|
ComponentTypeID |
getComponentTypeID()
Returns the com.metamatrix.common.config.ComponentTypeID that
identifies the type of pool these statistics represent. |
java.util.Collection |
getPoolResourceStatistics()
Returns list of resourceStatistics for all resources in the pool. |
ResourceAdapter |
getResourceAdapter()
Returns the resource adapter used to create the phyical resource objects. |
ResourceDescriptor |
getResourceDescriptor()
Returns the descriptor from which resources in the were created. |
ResourceDescriptorID |
getResourceDescriptorID()
Returns the resource descriptor ID for this pool that to identify the pool. |
int |
getResourcePoolSize()
Returns the current size of the resource pool. |
ResourcePoolStatistics |
getResourcePoolStatistics()
Returns the monitor for this pool. |
void |
init(ResourceDescriptor descriptor)
Call to initialize the pool based on the descriptor. |
protected void |
initResources()
|
void |
shutDown()
Call to shutDown all the resources in the pool. |
java.lang.String |
toString()
|
void |
update(java.util.Properties properties)
Call to update the pool management parameters based on the resource descriptor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ResourceDescriptor resourceDescriptor
protected static final java.lang.String CONTEXT
Constructor Detail |
---|
public BasicResourcePool()
Method Detail |
---|
public void init(ResourceDescriptor descriptor) throws ResourcePoolException
ResourcePool
init
in interface ResourcePool
descriptor
- which determines the type of resource and pool size parameters
ResourcePoolException
- is thrown if an error ocurrs during initializationpublic ResourceAdapter getResourceAdapter()
ResourcePool
getResourceAdapter
in interface ResourcePool
public int getResourcePoolSize()
ResourcePool
getResourcePoolSize
in interface ResourcePool
ResourceContainers
in the poolpublic ResourceDescriptor getResourceDescriptor()
descriptor
from which resources in the were created.
getResourceDescriptor
in interface ResourcePool
public ResourceDescriptorID getResourceDescriptorID()
ResourcePool
getResourceDescriptorID
in interface ResourcePool
public ComponentTypeID getComponentTypeID()
ResourcePool
com.metamatrix.common.config.ComponentTypeID
that
identifies the type of pool these statistics represent.
getComponentTypeID
in interface ResourcePool
public ResourcePoolStatistics getResourcePoolStatistics()
getResourcePoolStatistics
in interface ResourcePool
public java.util.Collection getPoolResourceStatistics()
getPoolResourceStatistics
in interface ResourcePool
public void shutDown()
Resource.shutDown
called.
shutDown
in interface ResourcePool
public void update(java.util.Properties properties) throws ResourcePoolException
ResourcePool
update
in interface ResourcePool
properties
- are the changes to be applied
ResourcePoolException
- is thrown if an error ocurrsprotected void finalize()
finalize
in class java.lang.Object
protected Resource checkResourceCache()
protected void initResources() throws ResourcePoolException
ResourcePoolException
public Resource checkOut(java.lang.String userName) throws ResourcePoolException
ResourcePool
checkOut
in interface ResourcePool
userName
- of who is requesting the resource
ResourcePoolException
- is thrown if an error occurspublic void checkIn(ResourceContainer resourceContainer, java.lang.String userName) throws ResourcePoolException
ResourcePool
checkIn
in interface ResourcePool
resourceContainer
- represents the physical resource instance being removed from the pooluserName
- of who has the resource checked out
ResourcePoolException
- is thrown if an error occurspublic void cleanUp()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |