Class SimpleFlowExecutionSnapshotFactory
java.lang.Object
org.springframework.webflow.execution.repository.snapshot.SimpleFlowExecutionSnapshotFactory
- All Implemented Interfaces:
FlowExecutionSnapshotFactory
public class SimpleFlowExecutionSnapshotFactory
extends Object
implements FlowExecutionSnapshotFactory
A factory that creates new flow execution snapshot instances that simply wraps an underlying
flow execution
instance.
Note: this class is generally only suitable for use with a repository that has maxSnapshots set to 1, since no actual
copies of the execution data are made by this factory. This class exists to support the use case where taking copies
of flow execution state is not needed.- Author:
- Keith Donald
-
Constructor Summary
ConstructorDescriptionSimpleFlowExecutionSnapshotFactory
(FlowExecutionFactory flowExecutionFactory, FlowDefinitionLocator flowDefinitionLocator) Creates a new simple flow execution snapshot factory -
Method Summary
Modifier and TypeMethodDescriptioncreateSnapshot
(FlowExecution flowExecution) Takes a snapshot of the flow execution.restoreExecution
(FlowExecutionSnapshot snapshot, String flowId, FlowExecutionKey key, MutableAttributeMap<Object> conversationScope, FlowExecutionKeyFactory keyFactory) Restores a flow execution from a previously taken snapshot.
-
Constructor Details
-
SimpleFlowExecutionSnapshotFactory
public SimpleFlowExecutionSnapshotFactory(FlowExecutionFactory flowExecutionFactory, FlowDefinitionLocator flowDefinitionLocator) Creates a new simple flow execution snapshot factory- Parameters:
flowDefinitionLocator
- the flow definition locatorflowExecutionFactory
- the flow execution factory
-
-
Method Details
-
createSnapshot
public FlowExecutionSnapshot createSnapshot(FlowExecution flowExecution) throws SnapshotCreationException Description copied from interface:FlowExecutionSnapshotFactory
Takes a snapshot of the flow execution.- Specified by:
createSnapshot
in interfaceFlowExecutionSnapshotFactory
- Parameters:
flowExecution
- the flow execution- Returns:
- the new snapshot
- Throws:
SnapshotCreationException
- if the snapshot could not be created
-
restoreExecution
public FlowExecution restoreExecution(FlowExecutionSnapshot snapshot, String flowId, FlowExecutionKey key, MutableAttributeMap<Object> conversationScope, FlowExecutionKeyFactory keyFactory) throws FlowExecutionRestorationFailureException Description copied from interface:FlowExecutionSnapshotFactory
Restores a flow execution from a previously taken snapshot.- Specified by:
restoreExecution
in interfaceFlowExecutionSnapshotFactory
- Parameters:
snapshot
- the previously taken snapshotflowId
- the id of the root flow definitionkey
- the flow execution keyconversationScope
- conversation scopekeyFactory
- factory for creating new snapshot keys- Returns:
- the restored flow execution
- Throws:
FlowExecutionRestorationFailureException
- if flow execution restoration fails
-