shocks.framework.workflow.filter.repository
Class Filter

java.lang.Object
  extended byshocks.framework.workflow.filter.repository.Filter
All Implemented Interfaces:
java.lang.Cloneable, Workflow

public class Filter
extends java.lang.Object
implements Workflow, java.lang.Cloneable

Filters are Workflow components dynamically generated according to the specifications in the workflow descriptor file. The Filter object itself provides an abstract framework for the execution of actions created by the developer.

Filters can be assigned Action components at the time they are constructed. Examples of these action components are classes which extend the ActionSupport and FilterSupport objects.

Each filter can perform actions at two points. The first point is on the way into the sequence of filters (when the flow of control is moving in the direction of the target Action). The second point is after the target Action has executed and the flow of control is moving back toward the WorkflowController.

Because Filter objects do not contain any business logic (only logic which controls the order in which business logic is executed), they rely on feedback from the actions to determine what happens next.


Field Summary
 java.lang.String INCOMING
          Name of the incoming action, which must be a valid FilterSupport class.
 java.lang.String NAME
          Name of the filter, taken from the workflow metadata.
 java.lang.String OUTGOING
          Name of the outgoing action, which must be a valid FilterSupport class.
 java.lang.String VERSION
          Current version of the filter, taken from the workflow metadata.
 
Constructor Summary
Filter(DataSource metadata, Action incoming, Action outgoing)
           
 
Method Summary
 java.lang.Object clone()
          Returns a clone of the object identical in all regards save its location in memory.
 DataSource forward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext ctx)
          This method will execute the incoming action, process the result String, forward control on to the next Workflow component in the Sequence (if appropriate), process the Result action, execute the outgoing action and return control back into its enclosing Workflow object.
 void init(Workflow next)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public final java.lang.String NAME
Name of the filter, taken from the workflow metadata.


VERSION

public final java.lang.String VERSION
Current version of the filter, taken from the workflow metadata.


INCOMING

public final java.lang.String INCOMING
Name of the incoming action, which must be a valid FilterSupport class.


OUTGOING

public final java.lang.String OUTGOING
Name of the outgoing action, which must be a valid FilterSupport class.

Constructor Detail

Filter

public Filter(DataSource metadata,
              Action incoming,
              Action outgoing)
Method Detail

init

public void init(Workflow next)

forward

public DataSource forward(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response,
                          javax.servlet.ServletContext ctx)
This method will execute the incoming action, process the result String, forward control on to the next Workflow component in the Sequence (if appropriate), process the Result action, execute the outgoing action and return control back into its enclosing Workflow object.

Specified by:
forward in interface Workflow
Parameters:
request - the HttpServletRequest Object for the current transaction
response - the HttpServletResponse Object for the current transaction
ctx - the ServletContext for the web application
Returns:
DataSource, usually a result object containing information about the success of the workflow sequence.

clone

public java.lang.Object clone()
Returns a clone of the object identical in all regards save its location in memory.