org.springframework.webflow.executor.support
Class FlowRequestHandler

java.lang.Object
  extended by org.springframework.webflow.executor.support.FlowRequestHandler

public class FlowRequestHandler
extends java.lang.Object

An immutable helper for flow controllers that encapsulates reusable workflow required to launch and resume flow executions using a FlowExecutor.

The handleFlowRequest(ExternalContext) method is the central helper operation and implements the following algorithm:

  1. Extract the flow execution id by calling FlowExecutorArgumentExtractor.extractFlowExecutionKey(ExternalContext).
  2. If a valid flow execution id was extracted, signal an event in that existing execution to resume it. The event to signal is determined by calling the FlowExecutorArgumentExtractor.extractEventId(ExternalContext) method. If no event can be extracted, the existing execution will be refreshed.
  3. If no flow execution id was extracted, launch a new flow execution. The top-level flow definition for which an execution is created is determined by extracting the flow id using the method FlowExecutorArgumentExtractor.extractFlowId(ExternalContext). If no valid flow id can be determined, an exception is thrown.

Author:
Keith Donald, Erwin Vervaet

Constructor Summary
FlowRequestHandler(FlowExecutor flowExecutor)
          Creates a new flow controller helper.
FlowRequestHandler(FlowExecutor flowExecutor, FlowExecutorArgumentExtractor argumentExtractor)
          Creates a new flow controller helper.
 
Method Summary
 FlowExecutorArgumentExtractor getArgumentExtractor()
          Returns the flow executor argument extractor used by this helper.
 FlowExecutor getFlowExecutor()
          Returns the flow executor used by this helper.
 ResponseInstruction handleFlowRequest(ExternalContext context)
          Handle a request into the Spring Web Flow system from an external system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowRequestHandler

public FlowRequestHandler(FlowExecutor flowExecutor)
Creates a new flow controller helper. Will use the default RequestParameterFlowExecutorArgumentHandler.

Parameters:
flowExecutor - the flow execution manager to delegate to

FlowRequestHandler

public FlowRequestHandler(FlowExecutor flowExecutor,
                          FlowExecutorArgumentExtractor argumentExtractor)
Creates a new flow controller helper.

Parameters:
flowExecutor - the flow executor to delegate to
argumentExtractor - the flow executor argument extractor to use
Method Detail

getFlowExecutor

public FlowExecutor getFlowExecutor()
Returns the flow executor used by this helper.


getArgumentExtractor

public FlowExecutorArgumentExtractor getArgumentExtractor()
Returns the flow executor argument extractor used by this helper.


handleFlowRequest

public ResponseInstruction handleFlowRequest(ExternalContext context)
                                      throws FlowException
Handle a request into the Spring Web Flow system from an external system.

Parameters:
context - the external context in which the request occured
Returns:
the selected view that should be rendered as a response
Throws:
FlowException


Copyright © 2004-2007. All Rights Reserved.