org.norther.tammi.spray.template.step
Class FlowStepAction

java.lang.Object
  extended by org.norther.tammi.spray.loader.task.Action
      extended by org.norther.tammi.spray.loader.task.ActionEvent
          extended by org.norther.tammi.spray.template.step.FlowStepAction
All Implemented Interfaces:
Serializable, Task, StepFlowConstants
Direct Known Subclasses:
NextStepAction

public class FlowStepAction
extends ActionEvent
implements StepFlowConstants

Extends ActionEvent by providing a step flow context as the context parameter. The pre-action executes a prepare method and the post-action executes a finish method. The submit-action executes a submitted action, if available, and a done method.

Note that the default implementation does nothing and can be applied as a nop action when required.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.norther.tammi.spray.template.flow.StepFlowConstants
ADAPTABLE_STATE, DISPOSABLE_STATE, EXPLICIT_STATE, FINISHED_STATE, HELP_PIPE_PROPERTY, QUALIFIED_STATE, READ_ONLY_STATE, REPOSITORY_PROPERTY, SELECTABLE_STATE
 
Constructor Summary
FlowStepAction()
          Constructs a new flow step action.
 
Method Summary
protected  boolean checkPermission(FlowStep step, int mask, FilterChain chain, StepFlowContext context)
          Checks access permission for the specified step.
protected  boolean checkPermission(int mask, FilterChain chain, StepFlowContext context)
          Checks access permission for the current step.
 void done(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Implements the default done method.
 void execute(ServletRequest request, ServletResponse response, FilterChain chain, Object context)
          Executes the submitted event.
 void execute(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Executes the submitted event.
 void finish(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Implements the default finish method.
 void forward(String path, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Implements the default forward method.
protected  String[] getPermissibleRoles(int mask, StepFlowContext context)
          Gets an array of role names permissible for the current flow.
protected  Class[] getSignature()
          Gets the signature.
 void include(String path, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Implements the default include method.
 void initialize(ServletRequest request, ServletResponse response, FilterChain chain, Object context)
          Initializes customized functionality after construction but before the first execution.
 void initialize(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Implements the default initialize method.
 void prepare(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Implements the default prepare method.
protected  void pushError(Throwable error, FilterChain chain)
          Pushes an execution error to the error stack.
 void submit(ServletRequest request, ServletResponse response, FilterChain chain, Object context)
          Implements the default submit method if the specific one is not implemented.
 void submit(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Implements the default submit method.
 void submitOpenHelp(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Submits a redirection to step help.
 
Methods inherited from class org.norther.tammi.spray.loader.task.ActionEvent
getAction, getAction, getAction, invoke
 
Methods inherited from class org.norther.tammi.spray.loader.task.Action
find, getFilter, getMBeanServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowStepAction

public FlowStepAction()
Constructs a new flow step action.

Method Detail

initialize

public void initialize(ServletRequest request,
                       ServletResponse response,
                       FilterChain chain,
                       Object context)
Description copied from interface: Task
Initializes customized functionality after construction but before the first execution. The initialization parameters are the same as given to the first execution.

Specified by:
initialize in interface Task
Overrides:
initialize in class ActionEvent
Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - a task specific context.

execute

public void execute(ServletRequest request,
                    ServletResponse response,
                    FilterChain chain,
                    Object context)
             throws Exception
Description copied from class: ActionEvent
Executes the submitted event.

Specified by:
execute in interface Task
Overrides:
execute in class ActionEvent
Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the context.
Throws:
Exception - on errors.

submit

public void submit(ServletRequest request,
                   ServletResponse response,
                   FilterChain chain,
                   Object context)
            throws Exception
Description copied from class: ActionEvent
Implements the default submit method if the specific one is not implemented. The default implementation does nothing.

Overrides:
submit in class ActionEvent
Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the template context.
Throws:
Exception - on errors.

execute

public void execute(ServletRequest request,
                    ServletResponse response,
                    FilterChain chain,
                    StepFlowContext context)
             throws Exception
Executes the submitted event.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

initialize

public void initialize(ServletRequest request,
                       ServletResponse response,
                       FilterChain chain,
                       StepFlowContext context)
Implements the default initialize method. The default implementation does nothing.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.

prepare

public void prepare(ServletRequest request,
                    ServletResponse response,
                    FilterChain chain,
                    StepFlowContext context)
             throws Exception
Implements the default prepare method. The default implementation does nothing.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

finish

public void finish(ServletRequest request,
                   ServletResponse response,
                   FilterChain chain,
                   StepFlowContext context)
            throws Exception
Implements the default finish method. The default implementation does nothing.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submit

public void submit(ServletRequest request,
                   ServletResponse response,
                   FilterChain chain,
                   StepFlowContext context)
            throws Exception
Implements the default submit method. The default implementation does nothing.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

done

public void done(ServletRequest request,
                 ServletResponse response,
                 FilterChain chain,
                 StepFlowContext context)
          throws Exception
Implements the default done method. The default implementation does nothing.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

forward

public void forward(String path,
                    ServletRequest request,
                    ServletResponse response,
                    FilterChain chain,
                    StepFlowContext context)
             throws Exception
Implements the default forward method.

Parameters:
path - the forward path.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

include

public void include(String path,
                    ServletRequest request,
                    ServletResponse response,
                    FilterChain chain,
                    StepFlowContext context)
             throws Exception
Implements the default include method.

Parameters:
path - the include path.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitOpenHelp

public void submitOpenHelp(ServletRequest request,
                           ServletResponse response,
                           FilterChain chain,
                           StepFlowContext context)
                    throws Exception
Submits a redirection to step help. The help flow is supposed to have a top level under which to find the root help flows of the task pipes.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

getPermissibleRoles

protected String[] getPermissibleRoles(int mask,
                                       StepFlowContext context)
                                throws Exception
Gets an array of role names permissible for the current flow.

Parameters:
mask - the action mask.
context - the flow context.
Returns:
an array of role names.
Throws:
Exception - on errors.

checkPermission

protected boolean checkPermission(int mask,
                                  FilterChain chain,
                                  StepFlowContext context)
Checks access permission for the current step.

Parameters:
mask - the action mask.
chain - the filter chain.
context - the flow context.
Returns:
true or false.

checkPermission

protected boolean checkPermission(FlowStep step,
                                  int mask,
                                  FilterChain chain,
                                  StepFlowContext context)
Checks access permission for the specified step.

Parameters:
step - the flow step.
mask - the action mask.
chain - the filter chain.
context - the flow context.
Returns:
true or false.

pushError

protected void pushError(Throwable error,
                         FilterChain chain)
Pushes an execution error to the error stack.

Parameters:
error - the error.
chain - the filter chain.

getSignature

protected Class[] getSignature()
Gets the signature.

Overrides:
getSignature in class ActionEvent
Returns:
the action signature.


Copyright © 2004 The Norther Organization. All rights reserved.