|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.wiley.posa3.resourcelifecyclemanager.ResourceLifecycleManager
The ResourceLifecycleManager class provides the primary interface for the RLM pattern. Using this class, one can acquire and release resources of different types. The RLM, makes use of multiple resource pools to manage the lifecycle of resources. If a resource is not found in the appropriate pool, a factory is used to create the resource. Once a resource has been created, it must be added to a resourceGroup by the user to allow it to be properly managed. It is assumed that each resource belongs to at least one group
| Constructor Summary | |
ResourceLifecycleManager()
Default Constructor |
|
| Method Summary | |
Resource |
acquire(ResourceType type)
This method tries to acquire a resource of the given type. |
void |
addResourceToGroup(ManagedResource resource,
ResourceGroup group)
Add a resource to an existing group. |
ResourceGroup |
createGroup(java.lang.String groupID,
ManagedResource[] resources)
Create a group and add all the resources to that group |
void |
release(ManagedResource resource)
Release the resource as well as any dependent resources. |
boolean |
release(ResourceGroup group)
Release all resources belonging to the ResourceGroup. |
void |
setFactory(ResourceType type,
ResourceFactory factory)
Set the factory for the type of resource |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ResourceLifecycleManager()
| Method Detail |
public Resource acquire(ResourceType type)
type - the type of resource to acquire
public ResourceGroup createGroup(java.lang.String groupID,
ManagedResource[] resources)
groupID - the id to assign to the new groupresources - [] an array of resources to add to the group
public void addResourceToGroup(ManagedResource resource,
ResourceGroup group)
resource - the resource to add to the groupgroup - the resource group to which the resouce should be addedpublic boolean release(ResourceGroup group)
group - the group whose resources should be released.
public void release(ManagedResource resource)
resource - the resource that should be released.
public void setFactory(ResourceType type,
ResourceFactory factory)
type - the type of the resourcefactory - the factory to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||