//==============================================================================
// Resource.java
//==============================================================================
package sample.resource;
/**
* Responsibilities:
* - represents a registered resource.
*
*
* @author Copyright 2003 Nikolas S. Boyd.
*/
public class Resource {
/** Contains the registered resources. */
private static Registry registry = null;
/**
* Returns the resource registry.
*/
public static synchronized Registry
getRegistry() {
if (registry == null) {
registry = new Registry();
}
return registry;
}
/**
* Returns the resource named (resourceName).
* @param resourceName identifies a registered resource.
* @return null if no such resource exists.
*/
public static Resource
named(String resourceName) {
return getRegistry().getResourceNamed(resourceName);
}
/** Identifies the resource. */
private String name;
/**
* Returns the resource name.
*/
public String getName() {
return name;
}
// ... additional resource features ...
} // Resource