|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourcePoolMgr
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 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.
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. |
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 |
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. |
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 resourceDescriptorID,
java.util.Properties properties)
Call to update the pool management parameters based on the resource descriptor. |
Method Detail |
---|
Resource getResource(ResourceDescriptor descriptor, java.lang.String userName) throws ResourcePoolException
descriptor
- that describes the resource to obtainuserName
- of the one requesting the resource
ResourcePoolException
- is thrown if an error occurs.
Check for type ResourceWaitTimeOutException
java.util.Collection getAllResourceDescriptorIDs() throws ResourcePoolException
ResourcePoolException
- is thrown if an error occurs.
Check for type ResourceWaitTimeOutException
ResourceDescriptorID
java.util.Collection getAllResourceDescriptors() throws ResourcePoolException
ResourcePoolException
- is thrown if an error occurs.
ResourceDescriptor
ResourceDescriptor getResourceDescriptor(ResourceDescriptorID descriptorID) throws ResourcePoolException
descriptorID
- is the id that identifies the resource descriptor
ResourcePoolException
- is thrown if an error occurs.void updateResourcePool(ResourceDescriptorID resourceDescriptorID, java.util.Properties properties) throws ResourcePoolException
resourceDescriptorID
- identifies the pool to updateproperties
- are the changes to be applied
ResourcePoolException
- is thrown if an error occurs.java.util.Collection getResourcePoolStatistics() throws ResourcePoolException
ResourcePoolStatistics
currently
active. An empty collection will be returned if no resource pools are active.
ResourcePoolException
- is thrown if an error occurs.java.util.Collection getResourcesStatisticsForPool(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourceStatistics
for the pool.
An empty collection will be returned if no resources exist in the pool.
ResourcePoolException
- is thrown if an error occurs.ResourcePoolStatistics getResourcePoolStatistics(ResourceDescriptorID descriptorID) throws ResourcePoolException
ResourcePool
does not exist for the
descriptorID
, then a null will be returned.
ResourcePoolException
- is thrown if an error occurs.void shutDown(ResourceDescriptorID descriptorID) throws ResourcePoolException
descriptorID
- for the pool to be shutdown
ResourcePoolException
- is thrown if an error occurs.void shutDown() throws ResourcePoolException
ResourcePoolException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |