Class ResourceManager

java.lang.Object
com.gargoylesoftware.base.resource.ResourceManager

public final class ResourceManager extends Object
An object that manages the resources allocated by the resource factories
Version:
$Revision: 1.3 $
  • Field Details

    • resourceFactories_

      private Map resourceFactories_
    • name_

      private final String name_
  • Constructor Details

    • ResourceManager

      public ResourceManager()
      Create an instance
    • ResourceManager

      public ResourceManager(String name)
      Create an instance
      Parameters:
      name - The name of this object.
  • Method Details

    • getResource

      public final Object getResource(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(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 attribute
      factory - The feature to be added to the Factory attribute
    • getResourceFactory

      private final ResourceFactory getResourceFactory(String name) throws ResourceFactoryNotFoundException
      Parameters:
      name - Description of Parameter
      Returns:
      The resourceFactory value
      Throws:
      ResourceFactoryNotFoundException - Description of Exception
    • toString

      public String toString()
      Return a string representation of this object
      Overrides:
      toString in class Object
      Returns:
      A string respresentation of this object.