Class SerializedFlowExecutionSnapshotFactory
java.lang.Object
org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory
- All Implemented Interfaces:
FlowExecutionSnapshotFactory
public class SerializedFlowExecutionSnapshotFactory
extends Object
implements FlowExecutionSnapshotFactory
A factory that creates new instances of flow execution snapshots based on standard Java serialization.
- Author:
- Keith Donald, Erwin Vervaet
-
Constructor Summary
ConstructorDescriptionSerializedFlowExecutionSnapshotFactory
(FlowExecutionFactory flowExecutionFactory, FlowDefinitionLocator flowDefinitionLocator) Creates a new serialized flow execution snapshot factory -
Method Summary
Modifier and TypeMethodDescriptioncreateSnapshot
(FlowExecution flowExecution) Takes a snapshot of the flow execution.boolean
Returns whether or not the snapshots should be compressed.restoreExecution
(FlowExecutionSnapshot snapshot, String flowId, FlowExecutionKey key, MutableAttributeMap<Object> conversationScope, FlowExecutionKeyFactory keyFactory) Restores a flow execution from a previously taken snapshot.void
setCompress
(boolean compress) Set whether or not the snapshots should be compressed.
-
Constructor Details
-
SerializedFlowExecutionSnapshotFactory
public SerializedFlowExecutionSnapshotFactory(FlowExecutionFactory flowExecutionFactory, FlowDefinitionLocator flowDefinitionLocator) Creates a new serialized flow execution snapshot factory- Parameters:
flowDefinitionLocator
- the flow definition locatorflowExecutionFactory
- the flow execution factory
-
-
Method Details
-
getCompress
public boolean getCompress()Returns whether or not the snapshots should be compressed. -
setCompress
public void setCompress(boolean compress) Set whether or not the snapshots should be compressed. -
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
-