com.gargoylesoftware.base.resource
Class ResourceManager

java.lang.Object
  extended bycom.gargoylesoftware.base.resource.ResourceManager

public final class ResourceManager
extends Object

An object that manages the resources allocated by the resource factories

Version:
$Revision: 1.4 $
Author:
Mike Bowler

Constructor Summary
ResourceManager()
          Create an instance
ResourceManager(String name)
          Create an instance
 
Method Summary
 void addFactory(String name, ResourceFactory factory)
          Adds a feature to the Factory attribute of the ResourceManager object
 Object getResource(String name)
          Return a resource from the specified factory
 void releaseAllResources()
          Release all resources
 void releaseResource(ManagedResource object)
          Release the specified resource
 String toString()
          Return a string representation of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager()
Create an instance


ResourceManager

public ResourceManager(String name)
Create an instance

Parameters:
name - The name of this object.
Method Detail

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

toString

public String toString()
Return a string representation of this object

Returns:
A string respresentation of this object.


Copyright © 1998-2005 Gargoyle Software Inc.. All Rights Reserved.