|
Spring Web Flow | ||||||||
| 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
FlowExecutionImplFactory is expected to be used to restore the execution to a usable state.
FlowExecutionImplFactory,
Serialized Form| Constructor Summary | |
|---|---|
FlowExecutionImpl()
Default constructor required for externalizable serialization. |
|
FlowExecutionImpl(Flow flow)
Create a new flow execution executing the provided flow. |
|
| Method Summary | |
|---|---|
protected org.springframework.webflow.engine.impl.FlowSessionImpl |
createFlowSession(Flow flow,
org.springframework.webflow.engine.impl.FlowSessionImpl parent)
Create a new flow session object. |
protected RequestControlContext |
createRequestContext(ExternalContext externalContext,
MessageContext messageContext)
Create a flow execution control context. |
FlowSession |
getActiveSession()
Returns the active flow session of this flow execution. |
AttributeMap<java.lang.Object> |
getAttributes()
Returns runtime execution attributes that may influence the behavior of flow artifacts, such as states and actions. |
java.lang.String |
getCaption()
|
MutableAttributeMap<java.lang.Object> |
getConversationScope()
Returns a mutable map for data held in "conversation scope". |
FlowDefinition |
getDefinition()
Returns the root flow definition associated with this executing flow. |
MutableAttributeMap<java.lang.Object> |
getFlashScope()
Returns a mutable map for data held in "flash scope". |
FlowExecutionKey |
getKey()
Returns the key assigned to this flow execution. |
FlowExecutionOutcome |
getOutcome()
Returns the outcome reached by this execution, or null if this execution has not yet ended. |
boolean |
hasEnded()
Returns a flag indicating if this execution has ended. |
boolean |
hasStarted()
Returns a flag indicating if this execution has been started. |
boolean |
isActive()
Is the flow execution active? A flow execution is active once it has an active
session and remains active until it has ended. |
void |
readExternal(java.io.ObjectInput in)
|
void |
resume(ExternalContext externalContext)
Resume this flow execution. |
void |
setCurrentState(java.lang.String stateId)
Jump to a state of the currently active flow. |
void |
start(MutableAttributeMap<?> input,
ExternalContext externalContext)
Start this flow execution. |
java.lang.String |
toString()
|
void |
viewRendered(View view,
RequestContext context)
|
void |
viewRendering(View view,
RequestContext context)
|
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 execution| Method Detail |
|---|
public java.lang.String getCaption()
public FlowExecutionKey getKey()
FlowExecutionContext
getKey in interface FlowExecutionContextnull if a key has not yet been assigned.public FlowDefinition getDefinition()
FlowExecutionContextA 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 FlowExecutionContextpublic boolean hasStarted()
FlowExecutionContext
hasStarted in interface FlowExecutionContextFlowExecutionContext.isActive()public boolean isActive()
FlowExecutionContextactive
session and remains active until it has ended.
isActive in interface FlowExecutionContextpublic boolean hasEnded()
FlowExecutionContext
hasEnded in interface FlowExecutionContextFlowExecutionContext.hasStarted(),
FlowExecutionContext.isActive()public FlowExecutionOutcome getOutcome()
FlowExecutionContext
getOutcome in interface FlowExecutionContextnull if this execution has not yet endedpublic FlowSession getActiveSession()
FlowExecutionContext
getActiveSession in interface FlowExecutionContextFlowExecutionContext.isActive()public MutableAttributeMap<java.lang.Object> getFlashScope()
FlowExecutionContext
getFlashScope in interface FlowExecutionContextpublic MutableAttributeMap<java.lang.Object> getConversationScope()
FlowExecutionContext
getConversationScope in interface FlowExecutionContextpublic AttributeMap<java.lang.Object> getAttributes()
FlowExecutionContext
getAttributes in interface FlowExecutionContext
public void start(MutableAttributeMap<?> input,
ExternalContext externalContext)
throws FlowExecutionException,
java.lang.IllegalStateException
FlowExecution
When this method returns, execution status is either "paused" or "ended". If ended, the flow execution cannot be
used again. If "paused", the flow execution may be resumed.
start in interface FlowExecutioninput - flow execution inputexternalContext - the external context representing the calling environment
FlowExecutionException - if an exception was thrown within a state of the flow execution during request
processing
java.lang.IllegalStateException
public void resume(ExternalContext externalContext)
throws FlowExecutionException,
java.lang.IllegalStateException
FlowExecution
resume in interface FlowExecutionexternalContext - the external context, representing the calling environment, where something happened this flow
execution should respond to
FlowExecutionException - if an exception was thrown within a state of the resumed flow execution during
event processing
java.lang.IllegalStateExceptionpublic void setCurrentState(java.lang.String stateId)
start(MutableAttributeMap, ExternalContext) operation and allows for jumping to an arbitrary flow state.
Useful for testing.
stateId - the identifier of the state to jump to
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
protected RequestControlContext createRequestContext(ExternalContext externalContext,
MessageContext messageContext)
externalContext - the external context triggering this request
protected org.springframework.webflow.engine.impl.FlowSessionImpl createFlowSession(Flow flow,
org.springframework.webflow.engine.impl.FlowSessionImpl parent)
flow - the flow that should be associated with the flow sessionparent - the flow session that should be the parent of the newly created flow session (may be null)
public void viewRendering(View view,
RequestContext context)
public void viewRendered(View view,
RequestContext context)
|
Spring Web Flow | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||