|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RequestContext
A context for a single request to manipulate a flow execution. Allows Web Flow users to access contextual information
about the executing request, as well as the governing active flow execution
.
The term request is used to describe a single call (thread) into the flow system by an external actor to manipulate exactly one flow execution.
A new instance of this object is typically created when one of the core operations supported by a flow execution is
invoked, either start
to launch the flow execution, signalEvent
to resume the flow
execution, or refresh
to reconstitute the flow execution's last view selection for purposes of
reissuing a user response.
Once created this context object is passed around throughout flow execution request processing where it may be accessed and reasoned upon by SWF-internal artifacts such as states, user-implemented action code, and state transition criteria.
When a call into a flow execution returns this object goes out of scope and is disposed of automatically. Thus a request context is an internal artifact used within a FlowExecution: this object is not exposed to external client code, e.g. a view implementation (JSP).
The requestScope
property may be used as a store for arbitrary data that should exist for
the life of this object. Request-scoped data, along with all data in flash scope
,
flow scope
and conversation scope
is available for exposing
to view templates via a model
property.
The web flow system will ensure that a RequestContext object is local to the current thread. It can be safely manipulated without needing to worry about concurrent access.
Note: this request context is in no way linked to an HTTP or Portlet request. It uses the familiar "request" naming convention to indicate a single call to manipulate a runtime execution of a flow definition.
Method Summary | |
---|---|
FlowDefinition |
getActiveFlow()
Returns the definition of the flow that is currently executing. |
AttributeMap |
getAttributes()
Returns a context map for accessing arbitrary attributes about the state of the current request. |
MutableAttributeMap |
getConversationScope()
Returns a mutable accessor for accessing and/or setting attributes in conversation scope. |
StateDefinition |
getCurrentState()
Returns the current state of the executing flow. |
ExternalContext |
getExternalContext()
Returns the external client context that originated (or triggered) this request. |
MutableAttributeMap |
getFlashScope()
Returns a mutable accessor for accessing and/or setting attributes in flash scope. |
FlowExecutionContext |
getFlowExecutionContext()
Returns contextual information about the flow execution itself. |
MutableAttributeMap |
getFlowScope()
Returns a mutable accessor for accessing and/or setting attributes in flow scope. |
Event |
getLastEvent()
Returns the last event signaled during this request. |
TransitionDefinition |
getLastTransition()
Returns the last state transition that executed in this request. |
AttributeMap |
getModel()
Returns the data model capturing the state of this context, suitable for exposing to clients (mostly web views). |
ParameterMap |
getRequestParameters()
Returns the immutable input parameters associated with this request into Spring Web Flow. |
MutableAttributeMap |
getRequestScope()
Returns a mutable accessor for accessing and/or setting attributes in request scope. |
void |
setAttributes(AttributeMap attributes)
Set the contextual attributes describing the state of this request. |
Method Detail |
---|
FlowDefinition getActiveFlow() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the flow execution has not been started at all, or if the execution has ended
and is no longer actively executingStateDefinition getCurrentState() throws java.lang.IllegalStateException
null
if this flow execution is in the
process of starting and has not yet entered its start state.
null
if in the process of starting
java.lang.IllegalStateException
- if this flow execution has not been started at all, or if this execution has ended
and is no longer actively executingMutableAttributeMap getRequestScope()
MutableAttributeMap getFlashScope()
MutableAttributeMap getFlowScope()
FlowSession
MutableAttributeMap getConversationScope()
FlowExecutionContext
ParameterMap getRequestParameters()
This is typically a convenient shortcut for accessing the ExternalContext.getRequestParameterMap()
directly.
getExternalContext()
ExternalContext getExternalContext()
Acting as a facade, the returned context object provides a single point of access to the calling client's environment. It provides normalized access to attributes of the client environment without tying you to specific constructs within that environment.
In addition, this context may be downcastable to a specific context type for a specific client environment, such
as a ServletExternalContext
for servlets or a
PortletExternalContext
for portlets. Such downcasting will
give you full access to a native HttpServletRequest, for example. With that said, for portability reasons you
should avoid coupling your flow artifacts to a specific deployment environment when possible.
FlowExecutionContext getFlowExecutionContext()
Event getLastEvent()
TransitionDefinition getLastTransition()
null
if no transition has occured yetAttributeMap getAttributes()
void setAttributes(AttributeMap attributes)
attributes
- the attributesAttributeMap getModel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |