Class ResourceManager
- java.lang.Object
-
- com.gargoylesoftware.base.resource.ResourceManager
-
public final class ResourceManager extends java.lang.Object
An object that manages the resources allocated by the resource factories- Version:
- $Revision: 1.3 $
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
name_
private java.util.Map
resourceFactories_
-
Constructor Summary
Constructors Constructor Description ResourceManager()
Create an instanceResourceManager(java.lang.String name)
Create an instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFactory(java.lang.String name, ResourceFactory factory)
Adds a feature to the Factory attribute of the ResourceManager objectjava.lang.Object
getResource(java.lang.String name)
Return a resource from the specified factoryprivate ResourceFactory
getResourceFactory(java.lang.String name)
void
releaseAllResources()
Release all resourcesvoid
releaseResource(ManagedResource object)
Release the specified resourcejava.lang.String
toString()
Return a string representation of this object
-
-
-
Method Detail
-
getResource
public final java.lang.Object getResource(java.lang.String name)
Return a resource from the specified factory- Parameters:
name
- The name of the factory- Returns:
- The specified resource
-
releaseResource
public final void releaseResource(ManagedResource object)
Release the specified resource- Parameters:
object
- The resource to release
-
releaseAllResources
public void releaseAllResources()
Release all resources
-
addFactory
public void addFactory(java.lang.String name, ResourceFactory factory)
Adds a feature to the Factory attribute of the ResourceManager object- Parameters:
name
- The feature to be added to the Factory attributefactory
- The feature to be added to the Factory attribute
-
getResourceFactory
private final ResourceFactory getResourceFactory(java.lang.String name) throws ResourceFactoryNotFoundException
- Parameters:
name
- Description of Parameter- Returns:
- The resourceFactory value
- Throws:
ResourceFactoryNotFoundException
- Description of Exception
-
toString
public java.lang.String toString()
Return a string representation of this object- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string respresentation of this object.
-
-