org.springframework.webflow.engine
Interface RequestControlContext

All Superinterfaces:
RequestContext
All Known Implementing Classes:
MockRequestControlContext

public interface RequestControlContext
extends RequestContext

Mutable control interface used to manipulate an ongoing flow execution in the context of one client request. Primarily used internally by the various flow artifacts when they are invoked.

This interface acts as a facade for core definition constructs such as the central Flow and State classes, abstracting away details about the runtime execution machine defined in the execution engine implementation package.

Note this type is not the same as the FlowExecutionContext. Objects of this type are request specific: they provide a control interface for manipulating exactly one flow execution locally from exactly one request. A FlowExecutionContext provides information about a single flow execution (conversation), and it's scope is not local to a specific request (or thread).

Author:
Keith Donald, Erwin Vervaet
See Also:
Flow, State, FlowExecution, FlowExecutionContext

Method Summary
 FlowSession endActiveFlowSession(MutableAttributeMap output)
          End the active flow session of the current flow execution.
 ViewSelection execute(Transition transition)
          Execute this transition out of the current source state.
 void setCurrentState(State state)
          Record the current state that has entered in the executing flow.
 void setLastEvent(Event lastEvent)
          Record the last event signaled in the executing flow.
 void setLastTransition(Transition lastTransition)
          Record the last transition that executed in the executing flow.
 ViewSelection signalEvent(Event event)
          Signals the occurence of an event in the current state of this flow execution request context.
 ViewSelection start(Flow flow, MutableAttributeMap input)
          Spawn a new flow session and activate it in the currently executing flow.
 
Methods inherited from interface org.springframework.webflow.execution.RequestContext
getActiveFlow, getAttributes, getConversationScope, getCurrentState, getExternalContext, getFlashScope, getFlowExecutionContext, getFlowScope, getLastEvent, getLastTransition, getModel, getRequestParameters, getRequestScope, setAttributes
 

Method Detail

setLastEvent

void setLastEvent(Event lastEvent)
Record the last event signaled in the executing flow. This method will be called as part of signaling an event in a flow to indicate the 'lastEvent' that was signaled.

Parameters:
lastEvent - the last event signaled
See Also:
Flow.onEvent(RequestControlContext)

setLastTransition

void setLastTransition(Transition lastTransition)
Record the last transition that executed in the executing flow. This method will be called as part of executing a transition from one state to another.

Parameters:
lastTransition - the last transition that executed
See Also:
Transition.execute(State, RequestControlContext)

setCurrentState

void setCurrentState(State state)
Record the current state that has entered in the executing flow. This method will be called as part of entering a new state by the State type itself.

Parameters:
state - the current state
See Also:
State.enter(RequestControlContext)

start

ViewSelection start(Flow flow,
                    MutableAttributeMap input)
                    throws FlowExecutionException
Spawn a new flow session and activate it in the currently executing flow. Also transitions the spawned flow to its start state. This method should be called by clients that wish to spawn new flows, such as subflow states.

This will start a new flow session in the current flow execution, which is already active.

Parameters:
flow - the flow to start, its start() method will be called
input - initial contents of the newly created flow session (may be null, e.g. empty)
Returns:
the selected starting view, which returns control to the client and requests that a view be rendered with model data
Throws:
FlowExecutionException - if an exception was thrown within a state of the flow during execution of this start operation
See Also:
Flow.start(RequestControlContext, MutableAttributeMap)

signalEvent

ViewSelection signalEvent(Event event)
                          throws FlowExecutionException
Signals the occurence of an event in the current state of this flow execution request context. This method should be called by clients that report internal event occurences, such as action states. The onEvent() method of the flow involved in the flow execution will be called.

Parameters:
event - the event that occured
Returns:
the next selected view, which returns control to the client and requests that a view be rendered with model data
Throws:
FlowExecutionException - if an exception was thrown within a state of the flow during execution of this signalEvent operation
See Also:
Flow.onEvent(RequestControlContext)

endActiveFlowSession

FlowSession endActiveFlowSession(MutableAttributeMap output)
                                 throws java.lang.IllegalStateException
End the active flow session of the current flow execution. This method should be called by clients that terminate flows, such as end states. The end() method of the flow involved in the flow execution will be called.

Parameters:
output - output produced by the session that is eligible for mapping by a resuming parent flow
Returns:
the ended session
Throws:
java.lang.IllegalStateException - when the flow execution is not active
See Also:
Flow.end(RequestControlContext, MutableAttributeMap)

execute

ViewSelection execute(Transition transition)
Execute this transition out of the current source state. Allows for privileged execution of an arbitrary transition.

Parameters:
transition - the transition
Returns:
a new view selection
See Also:
Transition.execute(State, RequestControlContext)


Copyright © 2004-2007. All Rights Reserved.