|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository
org.springframework.webflow.execution.repository.snapshot.AbstractSnapshottingFlowExecutionRepository
org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository
public class DefaultFlowExecutionRepository
The default flow execution repository implementation. Takes one to max
flow
execution snapshots, where each snapshot represents a copy of a FlowExecution
taken at a point in time.
The set of active flow executions are managed by a ConversationManager
implementation, which this repository
delegates to.
This repository is responsible for:
Conversation
when a FlowExecution
is assigned a persistent key. Each conversation
is assigned a unique conversation id which forms one part of the flow execution key.
execution snapshots
to persist flow execution state. A snapshot is a copy of
the execution created at a point in time that can be restored and continued. Snapshotting supports users going
back in their browser to continue their flow execution from a previoius point.
This repository implementation also provides support for execution invalidation after completion, where once a logical flow execution completes, it and all of its snapshots are removed. This cleans up memory and prevents the possibility of duplicate submission after completion.
Field Summary |
---|
Fields inherited from class org.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository |
---|
logger |
Constructor Summary | |
---|---|
DefaultFlowExecutionRepository(ConversationManager conversationManager,
FlowExecutionSnapshotFactory snapshotFactory)
Create a new default flow execution repository using the given state restorer, conversation manager, and snapshot factory. |
Method Summary | |
---|---|
protected FlowExecutionSnapshotGroup |
createFlowExecutionSnapshotGroup()
|
FlowExecution |
getFlowExecution(FlowExecutionKey key)
Return the FlowExecution indexed by the provided key. |
int |
getMaxSnapshots()
Returns the max number of snapshots allowed per flow execution by this repository. |
protected FlowExecutionSnapshotGroup |
getSnapshotGroup(Conversation conversation)
Returns the snapshot group associated with the governing conversation. |
protected java.io.Serializable |
nextSnapshotId(java.io.Serializable executionId)
The next snapshot id to use for a FlowExecution instance. |
void |
putFlowExecution(FlowExecution flowExecution)
Place the FlowExecution in this repository under the provided key. |
void |
removeAllFlowExecutionSnapshots(FlowExecution execution)
Remove all snapshots associated with the flow execution from storage, invalidating all history. |
void |
removeFlowExecutionSnapshot(FlowExecution execution)
Remove the snapshot that was used to restore this flow execution, discarding it for future use. |
void |
setMaxSnapshots(int maxSnapshots)
Sets the maximum number of snapshots allowed per flow execution by this repository. |
void |
updateFlowExecutionSnapshot(FlowExecution execution)
Capture the current state of the flow execution by updating its snapshot in storage. |
Methods inherited from class org.springframework.webflow.execution.repository.snapshot.AbstractSnapshottingFlowExecutionRepository |
---|
getSnapshotFactory, getSnapshotId, putConversationScope, restoreFlowExecution, snapshot |
Methods inherited from class org.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository |
---|
assertKeySet, createConversationParameters, getAlwaysGenerateNewNextKey, getConversation, getConversation, getConversationManager, getKey, getLock, parseFlowExecutionKey, removeFlowExecution, setAlwaysGenerateNewNextKey |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFlowExecutionRepository(ConversationManager conversationManager, FlowExecutionSnapshotFactory snapshotFactory)
conversationManager
- the conversation manager to usesnapshotFactory
- the flow execution snapshot factory to useMethod Detail |
---|
public int getMaxSnapshots()
public void setMaxSnapshots(int maxSnapshots)
protected java.io.Serializable nextSnapshotId(java.io.Serializable executionId)
AbstractFlowExecutionRepository
FlowExecution
instance. Called when getting a flow execution key
.
nextSnapshotId
in class AbstractFlowExecutionRepository
public FlowExecution getFlowExecution(FlowExecutionKey key)
FlowExecutionRepository
FlowExecution
indexed by the provided key. The returned flow execution represents the
restored state of an executing flow from a point in time. This should be called to resume a persistent flow
execution. Before calling this method, you should acquire the lock for the keyed flow execution.
getFlowExecution
in interface FlowExecutionRepository
getFlowExecution
in class AbstractFlowExecutionRepository
key
- the flow execution key
public void putFlowExecution(FlowExecution flowExecution)
FlowExecutionRepository
FlowExecution
in this repository under the provided key. This should be called to save
or update the persistent state of an active (but paused) flow execution. Before calling this method, you should
acquire the lock for the keyed flow execution.
putFlowExecution
in interface FlowExecutionRepository
putFlowExecution
in class AbstractFlowExecutionRepository
flowExecution
- the flow executionpublic void updateFlowExecutionSnapshot(FlowExecution execution)
FlowExecutionKeyFactory
execution
- the flow executionpublic void removeFlowExecutionSnapshot(FlowExecution execution)
FlowExecutionKeyFactory
execution
- the flow executionpublic void removeAllFlowExecutionSnapshots(FlowExecution execution)
FlowExecutionKeyFactory
execution
- the flow executionprotected FlowExecutionSnapshotGroup createFlowExecutionSnapshotGroup()
protected FlowExecutionSnapshotGroup getSnapshotGroup(Conversation conversation)
conversation
- the conversation where the snapshot group is stored
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |