com.livinglogic.struts.workflow
Class Workflow

java.lang.Object
  extended bycom.livinglogic.struts.workflow.Workflow
All Implemented Interfaces:
Serializable

public class Workflow
extends Object
implements Serializable

Class that represents and stores information about a labeled workflow.

Since:
$Name: $
Version:
$Revision: 1.3 $, $Date: 2004/04/08 14:58:23 $
Author:
A. Lamm, M. Bauer, $Author: jason_pratt $
See Also:
Serialized Form

Constructor Summary
Workflow()
           
 
Method Summary
 void addCleanupObject(String name, WorkflowCleanup object)
          Registers a named implementation of the WorkflowCleanup command pattern to be processed at the termination of this workflow.
 void clearAttributes()
          Clears all known names/values.
 Object getAttribute(String attributeName)
          Retrieve the value associated with the specified name.
 Set getAttributeNames()
           
 Set getCleanupObjectNames()
           
 String getCurrentState()
          Returns the label of the current state.
 Object removeAttribute(String attributeName)
          Remove the value associated with the specified name and return it.
 void setAttribute(String attributeName, Object attributeValue)
          Associate a value with the specified name which will remain available until this workflow terminates or it is removed using the removeAttribute() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Workflow

public Workflow()
Method Detail

getCleanupObjectNames

public Set getCleanupObjectNames()
Returns:
The names of all known cleanup objects for this workflow. May be null if there are none

getAttributeNames

public Set getAttributeNames()
Returns:
The names of all known attributes for this workflow. May be null if there are no known attributes.

getAttribute

public Object getAttribute(String attributeName)
Retrieve the value associated with the specified name.

Parameters:
attributeName - The name of the requested value
Returns:
The value associated with the specified name. May be null if the attribute with the specified name is unknown.

removeAttribute

public Object removeAttribute(String attributeName)
Remove the value associated with the specified name and return it.

Parameters:
attributeName - The name of the value that is to be removed.
Returns:
The value associated with the specified name that was removed. May be null if the attribute with the specified name is unknown.

setAttribute

public void setAttribute(String attributeName,
                         Object attributeValue)
                  throws IllegalArgumentException
Associate a value with the specified name which will remain available until this workflow terminates or it is removed using the removeAttribute() method.

Parameters:
attributeName - The name associated with the value to be stored.
attributeValue - The value to be associated with the name and stored. If an attribute is already stored under the specified name for this workflow, it is replaced by this one.
Throws:
IllegalArgmentException - If the attribute name is null.
IllegalArgumentException

clearAttributes

public void clearAttributes()
Clears all known names/values.


addCleanupObject

public void addCleanupObject(String name,
                             WorkflowCleanup object)
                      throws IllegalArgumentException
Registers a named implementation of the WorkflowCleanup command pattern to be processed at the termination of this workflow. The order in which cleanup objects are executed is the reverse order in which they are added, i. e. the object that was added last will be processed first.

Parameters:
name - symbolic name under which the object is known. If an object is already registered under the specified name for this workflow, an exception is thrown
object - command pattern implementation to be processed.
Throws:
IllegalArgumentException, - if a cleanup object with the name of an already existing one is added
IllegalArgumentException

getCurrentState

public String getCurrentState()
Returns the label of the current state.



Copyright © 2004 Struts Workflow Extension Team. All Rights Reserved.