|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.engine.impl.FlowExecutionImpl
public class FlowExecutionImpl
Default implementation of FlowExecution that uses a stack-based data structure to manage spawned flow sessions. This
class is closely coupled with package-private FlowSessionImpl
and
RequestControlContextImpl
. The three classes work together to form a complete flow execution
implementation based on a finite state machine.
This implementation of FlowExecution is serializable so it can be safely stored in an HTTP session or other
persistent store such as a file, database, or client-side form field. Once deserialized, the
FlowExecutionImplStateRestorer
strategy is expected to be used to restore the execution to a usable state.
FlowExecutionImplFactory
,
FlowExecutionImplStateRestorer
,
Serialized FormConstructor Summary | |
---|---|
FlowExecutionImpl()
Default constructor required for externalizable serialization. |
|
FlowExecutionImpl(Flow flow)
Create a new flow execution executing the provided flow. |
|
FlowExecutionImpl(Flow flow,
FlowExecutionListener[] listeners,
AttributeMap attributes)
Create a new flow execution executing the provided flow. |
Method Summary | |
---|---|
protected FlowSession |
activateSession(Flow flow)
Activate a new FlowSession for the flow definition. |
protected RequestControlContext |
createControlContext(ExternalContext externalContext)
Create a flow execution control context. |
FlowSession |
endActiveFlowSession()
End the active flow session, popping it of the stack. |
FlowSession |
getActiveSession()
Returns the active flow session of this flow execution. |
AttributeMap |
getAttributes()
Returns runtime execution attributes that may influence the behavior of flow artifacts, such as states and actions. |
java.lang.String |
getCaption()
|
MutableAttributeMap |
getConversationScope()
Returns a mutable map for data held in "conversation scope". |
FlowDefinition |
getDefinition()
Returns the root flow definition associated with this executing flow. |
protected ViewSelection |
handleException(FlowExecutionException exception,
RequestControlContext context)
Handles an exception that occured performing an operation on this flow execution. |
boolean |
isActive()
Is the flow execution active? |
protected ViewSelection |
pause(RequestControlContext context,
ViewSelection selectedView)
Pause this flow execution. |
void |
readExternal(java.io.ObjectInput in)
|
ViewSelection |
refresh(ExternalContext externalContext)
Refresh this flow execution, asking the current view selection to be reconstituted to support reissuing the last response. |
protected void |
resume(RequestControlContext context)
Resume this flow execution. |
protected void |
setCurrentState(State newState)
Set the state that is currently active in this flow execution. |
ViewSelection |
signalEvent(java.lang.String eventId,
ExternalContext externalContext)
Signal an occurrence of the specified user event in the current state of this executing flow. |
ViewSelection |
start(MutableAttributeMap input,
ExternalContext externalContext)
Start this flow execution, transitioning it to the root flow's start state and returning the starting view selection needed to issue an initial user response. |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FlowExecutionImpl()
public FlowExecutionImpl(Flow flow)
flow
- the root flow of this flow executionpublic FlowExecutionImpl(Flow flow, FlowExecutionListener[] listeners, AttributeMap attributes)
flow
- the root flow of this flow executionlisteners
- the listeners interested in flow execution lifecycle eventsattributes
- flow execution system attributesMethod Detail |
---|
public java.lang.String getCaption()
public FlowDefinition getDefinition()
FlowExecutionContext
A call to this method always returns the same flow definition -- the top-level "root" -- no matter what flow may actually be active (for example, if subflows have been spawned).
getDefinition
in interface FlowExecutionContext
public boolean isActive()
FlowExecutionContext
All methods on an active flow execution context can be called successfully. If the flow execution is not active,
a caller cannot access some methods such as FlowExecutionContext.getActiveSession()
.
isActive
in interface FlowExecutionContext
public FlowSession getActiveSession()
FlowExecutionContext
getActiveSession
in interface FlowExecutionContext
public MutableAttributeMap getConversationScope()
FlowExecutionContext
getConversationScope
in interface FlowExecutionContext
public AttributeMap getAttributes()
FlowExecutionContext
getAttributes
in interface FlowExecutionContext
public ViewSelection start(MutableAttributeMap input, ExternalContext externalContext) throws FlowExecutionException
FlowExecution
This will start the entire flow execution from scratch.
start
in interface FlowExecution
input
- input attributes to pass to the flow, which the flow may choose to map into its scopeexternalContext
- the external context in which the starting event occured
FlowExecutionException
- if an exception was thrown within a state of the flow execution during request
processingpublic ViewSelection signalEvent(java.lang.String eventId, ExternalContext externalContext) throws FlowExecutionException
FlowExecution
signalEvent
in interface FlowExecution
eventId
- the identifier of the user event that occuredexternalContext
- the external context in which the event occured
FlowExecutionException
- if an exception was thrown within a state of the resumed flow execution during
event processingpublic ViewSelection refresh(ExternalContext externalContext) throws FlowExecutionException
FlowExecution
refresh
in interface FlowExecution
externalContext
- the externa context in which the refresh event occured
FlowExecutionException
- if an exception was thrown within a state of the resumed flow execution during
event processingprotected void resume(RequestControlContext context)
context
- the state request contextprotected ViewSelection pause(RequestControlContext context, ViewSelection selectedView)
context
- the request control contextselectedView
- the initial selected view to render
protected ViewSelection handleException(FlowExecutionException exception, RequestControlContext context) throws FlowExecutionException
exception
- the exception that occuredcontext
- the request control context the exception occured in
FlowExecutionException
- rethrows the exception if it was not handled at the state or flow levelprotected RequestControlContext createControlContext(ExternalContext externalContext)
externalContext
- the external context triggering this requestprotected void setCurrentState(State newState)
newState
- the new current stateprotected FlowSession activateSession(Flow flow)
FlowSession
for the flow definition. Creates the new flow session and pushes it
onto the stack.
flow
- the flow definition
public FlowSession endActiveFlowSession()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |