|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.pooling.impl.ResourcePoolMgrImpl
public class ResourcePoolMgrImpl
The ResourcePoolMgr is the center point for managing and sharing a common object type among common users. The benefit of managing an object as a resource is so that common users can share the object without the overhead of reoccurring object creation, desctruction and cleanup. To utilize the resource pooling feature the following needs to be done:
ResourceType
:ResourceDescriptor
implementations that are of that type.
Therefore, there is a one-to-many relationship between the
resource type and descriptor, respectfully.ResourceDescriptor
:/ResourceType
provides the unique identifier.Resource
:BaseResource
.ResourceAdapter
:ResourcePool
to create new resource object instances, as
well as, close existing instances. Once the appropriate set of classes have been implemented for a resource, the following are the steps for using a resource:
ResourceDescriptor
and call ResourcePoolMgr.getResource(com.metamatrix.common.config.api.ResourceDescriptor, java.lang.String)
to obtain a resource instance from the pool. Resource.closeResource()
method
must be called in order to release the resource back to the pool for reuse.
Constructor Summary | |
---|---|
ResourcePoolMgrImpl()
|
Method Summary | |
---|---|
java.util.Collection |
getAllResourceDescriptorIDs()
Call to get id's for all the current resource pools. |
java.util.Collection |
getAllResourceDescriptors()
Call to get all the resource descriptors for the current pools. |
protected ResourcePoolMgrImpl |
getInstance()
|
Resource |
getResource(ResourceDescriptor descriptor,
java.lang.String userName)
Call to get a resource from the pool defined by descriptor. |
ResourceDescriptor |
getResourceDescriptor(ResourceDescriptorID descriptorID)
Call to get the resource descriptor for the specified id |
ResourcePool |
getResourcePool(ResourceDescriptor descriptor)
Do Not call this method to update the resource pool This method was made available for testing |
ResourcePool |
getResourcePool(ResourceDescriptorID descriptorID)
Do Not call this method to update the resource pool This method was made available for testing |
java.util.Collection |
getResourcePools()
Do Not call this method to update the resource pool This method was made available for testing |
java.util.Collection |
getResourcePoolStatistics()
Returns all the ResourcePoolStatistics currently
active. |
ResourcePoolStatistics |
getResourcePoolStatistics(ResourceDescriptorID descriptorID)
Returns the statistics for a specific resource descriptor id. |
java.util.Collection |
getResourcesStatisticsForPool(ResourceDescriptorID descriptorID)
Returns all the ResourceStatistics for the pool. |
protected void |
init()
|
protected java.util.Collection |
rd1$()
|
protected java.util.Collection |
rd2$()
|
protected ResourceDescriptor |
rd3$(ResourceDescriptorID descriptorID)
|
protected ResourcePool |
rp1$(ResourceDescriptor descriptor)
|
protected ResourcePool |
rp2$(ResourceDescriptorID descriptorID)
|
protected java.util.Collection |
rp4$()
|
protected java.util.Collection |
rps1$()
|
protected ResourcePoolStatistics |
rps2$(ResourceDescriptorID descriptorID)
|
protected java.util.Collection |
rsp1$(ResourceDescriptorID descriptorID)
|
protected void |
sd1$()
|
protected void |
sd2$(ResourceDescriptorID descriptorID)
|
protected void |
setIsBeingShutDown(boolean shutDown)
|
void |
shutDown()
Call to shutdown all resource pools and all the resources within those pools. |
void |
shutDown(ResourceDescriptorID descriptorID)
Call to shutdown all resources in the specific pool identified by the descriptor ID. |
void |
updateResourcePool(ResourceDescriptorID descriptorID,
java.util.Properties props)
Call to update the pool management parameters based on the resource descriptor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourcePoolMgrImpl()
Method Detail |
---|
public Resource getResource(ResourceDescriptor descriptor, java.lang.String userName) throws ResourcePoolException
getResource
in interface ResourcePoolMgr
descriptor
- that describes the resource to obtainuserName
- of the one requesting the resource
ResourcePoolException
- is thrown if an error ocurrs.
Check for type ResourceWaitTimeOutException
public java.util.Collection getAllResourceDescriptorIDs() throws ResourcePoolException
getAllResourceDescriptorIDs
in interface ResourcePoolMgr
ResourcePoolException
- is thrown if an error ocurrs.
Check for type ResourceWaitTimeOutException
public java.util.Collection getAllResourceDescriptors() throws ResourcePoolException
ResourcePoolMgr
getAllResourceDescriptors
in interface ResourcePoolMgr
ResourcePoolException
- is thrown if an error occurs.
ResourceDescriptor
public ResourceDescriptor getResourceDescriptor(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolMgr
getResourceDescriptor
in interface ResourcePoolMgr
descriptorID
- is the id that identifies the resource descriptor
ResourcePoolException
- is thrown if an error occurs.public void updateResourcePool(ResourceDescriptorID descriptorID, java.util.Properties props) throws ResourcePoolException
ResourcePoolMgr
updateResourcePool
in interface ResourcePoolMgr
descriptorID
- identifies the pool to updateprops
- are the changes to be applied
ResourcePoolException
- is thrown if an error occurs.public java.util.Collection getResourcePoolStatistics() throws ResourcePoolException
ResourcePoolMgr
ResourcePoolStatistics
currently
active. An empty collection will be returned if no resource pools are active.
getResourcePoolStatistics
in interface ResourcePoolMgr
ResourcePoolException
- is thrown if an error occurs.public ResourcePoolStatistics getResourcePoolStatistics(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolMgr
ResourcePool
does not exist for the
descriptorID
, then a null will be returned.
getResourcePoolStatistics
in interface ResourcePoolMgr
ResourcePoolException
- is thrown if an error occurs.public java.util.Collection getResourcesStatisticsForPool(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolMgr
ResourceStatistics
for the pool.
An empty collection will be returned if no resources exist in the pool.
getResourcesStatisticsForPool
in interface ResourcePoolMgr
ResourcePoolException
- is thrown if an error occurs.public void shutDown(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolMgr
shutDown
in interface ResourcePoolMgr
descriptorID
- for the pool to be shutdown
ResourcePoolException
- is thrown if an error occurs.public void shutDown() throws ResourcePoolException
ResourcePoolMgr
shutDown
in interface ResourcePoolMgr
ResourcePoolException
public ResourcePool getResourcePool(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolException
public ResourcePool getResourcePool(ResourceDescriptor descriptor) throws ResourcePoolException
ResourcePoolException
public java.util.Collection getResourcePools() throws ResourcePoolException
ResourcePoolException
protected ResourcePoolMgrImpl getInstance() throws ResourcePoolException
ResourcePoolException
protected void init() throws ResourcePoolException
ResourcePoolException
protected void setIsBeingShutDown(boolean shutDown)
protected ResourcePool rp1$(ResourceDescriptor descriptor)
protected ResourcePool rp2$(ResourceDescriptorID descriptorID)
protected java.util.Collection rd2$() throws ResourcePoolException
ResourcePoolException
protected java.util.Collection rd1$() throws ResourcePoolException
ResourcePoolException
protected ResourceDescriptor rd3$(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolException
protected java.util.Collection rp4$()
protected java.util.Collection rps1$() throws ResourcePoolException
ResourcePoolException
protected ResourcePoolStatistics rps2$(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolException
protected java.util.Collection rsp1$(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolException
protected void sd1$() throws ResourcePoolException
ResourcePoolException
protected void sd2$(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePoolException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |