org.apache.commons.workflow.base
Class BaseRegistry

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

public class BaseRegistry
extends java.lang.Object
implements org.apache.commons.workflow.Registry

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

Version:
$Revision: 1.3 $ $Date: 2004/02/28 03:35:54 $

Field Summary
protected  java.util.HashMap activities
          The set of Activity instances registered with this Registry, keyed by identifier.
protected static org.apache.commons.workflow.Registry registry
          The singleton registry instance.
 
Constructor Summary
BaseRegistry()
           
 
Method Summary
 void addActivity(org.apache.commons.workflow.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.
 org.apache.commons.workflow.Activity[] findActivities()
          Return the complete set of Activity instances associated with this Activity.
 org.apache.commons.workflow.Activity findActivity(java.lang.String id)
          Return the registered Activity with the specified identifier, if any; otherwise return null.
static org.apache.commons.workflow.Registry getRegistry()
          Factory method to return a Singleton (per class loader) Registry instance.
 void removeActivity(org.apache.commons.workflow.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 java.util.HashMap activities
The set of Activity instances registered with this Registry, keyed by identifier.


registry

protected static org.apache.commons.workflow.Registry registry
The singleton registry instance.

Constructor Detail

BaseRegistry

public BaseRegistry()
Method Detail

addActivity

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

Specified by:
addActivity in interface org.apache.commons.workflow.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 org.apache.commons.workflow.Registry

findActivities

public org.apache.commons.workflow.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 org.apache.commons.workflow.Registry

findActivity

public org.apache.commons.workflow.Activity findActivity(java.lang.String id)
Return the registered Activity with the specified identifier, if any; otherwise return null.

Specified by:
findActivity in interface org.apache.commons.workflow.Registry
Parameters:
id - Identifier of the desired Activity

removeActivity

public void removeActivity(org.apache.commons.workflow.Activity activity)
Remove the specified Activity from this Registry.

Specified by:
removeActivity in interface org.apache.commons.workflow.Registry
Parameters:
activity - The Activity to be removed

getRegistry

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



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