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
ConstructorsConstructorDescriptionSerializedFlowExecutionSnapshotFactory(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.booleanReturns 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.voidsetCompress(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:FlowExecutionSnapshotFactoryTakes a snapshot of the flow execution.- Specified by:
createSnapshotin 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:FlowExecutionSnapshotFactoryRestores a flow execution from a previously taken snapshot.- Specified by:
restoreExecutionin 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
-