org.apache.commons.workflow.base
Class BaseRegistry

java.lang.Object
  extended by org.apache.commons.workflow.base.BaseRegistry
All Implemented Interfaces:
Registry

public class BaseRegistry
extends Object
implements Registry

BaseRegistry is a convenient base class for more sophisticated Registry implementations.

Version:
$Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $
Author:
Craig R. McClanahan

Field Summary
protected  HashMap activities
          The set of Activity instances registered with this Registry, keyed by identifier.
protected static Registry registry
          The singleton registry instance.
 
Constructor Summary
BaseRegistry()
           
 
Method Summary
 void addActivity(Activity activity)
          Add a new Activity to the set of Activity instances known to this Registry.
 void clear()
          Clear any existing Activity instances registered with this Registry.
 Activity[] findActivities()
          Return the complete set of Activity instances associated with this Activity.
 Activity findActivity(String id)
          Return the registered Activity with the specified identifier, if any; otherwise return null.
static Registry getRegistry()
          Factory method to return a Singleton (per class loader) Registry instance.
 void removeActivity(Activity activity)
          Remove the specified Activity from this Registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activities

protected HashMap activities
The set of Activity instances registered with this Registry, keyed by identifier.


registry

protected static Registry registry
The singleton registry instance.

Constructor Detail

BaseRegistry

public BaseRegistry()
Method Detail

addActivity

public void addActivity(Activity activity)
Add a new Activity to the set of Activity instances known to this Registry.

Specified by:
addActivity in interface Registry
Parameters:
activity - The new activity to be added

clear

public void clear()
Clear any existing Activity instances registered with this Registry.

Specified by:
clear in interface Registry

findActivities

public Activity[] findActivities()
Return the complete set of Activity instances associated with this Activity. If there are no such registered Activity instances, a zero-length array is returned.

Specified by:
findActivities in interface Registry

findActivity

public Activity findActivity(String id)
Return the registered Activity with the specified identifier, if any; otherwise return null.

Specified by:
findActivity in interface Registry
Parameters:
id - Identifier of the desired Activity

removeActivity

public void removeActivity(Activity activity)
Remove the specified Activity from this Registry.

Specified by:
removeActivity in interface Registry
Parameters:
activity - The Activity to be removed

getRegistry

public static Registry getRegistry()
Factory method to return a Singleton (per class loader) Registry instance.



Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.