org.springframework.webflow.execution.repository.snapshot
Class SimpleFlowExecutionSnapshotFactory

java.lang.Object
  extended by org.springframework.webflow.execution.repository.snapshot.SimpleFlowExecutionSnapshotFactory
All Implemented Interfaces:
FlowExecutionSnapshotFactory

public class SimpleFlowExecutionSnapshotFactory
extends java.lang.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
SimpleFlowExecutionSnapshotFactory(FlowExecutionFactory flowExecutionFactory, FlowDefinitionLocator flowDefinitionLocator)
          Creates a new simple flow execution snapshot factory
 
Method Summary
 FlowExecutionSnapshot createSnapshot(FlowExecution flowExecution)
          Takes a snapshot of the flow execution.
 FlowExecution restoreExecution(FlowExecutionSnapshot snapshot, java.lang.String flowId, FlowExecutionKey key, MutableAttributeMap conversationScope, FlowExecutionKeyFactory keyFactory)
          Restores a flow execution from a previously taken snapshot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFlowExecutionSnapshotFactory

public SimpleFlowExecutionSnapshotFactory(FlowExecutionFactory flowExecutionFactory,
                                          FlowDefinitionLocator flowDefinitionLocator)
Creates a new simple flow execution snapshot factory

Parameters:
flowDefinitionLocator - the flow definition locator
flowExecutionFactory - the flow execution factory
Method Detail

createSnapshot

public FlowExecutionSnapshot createSnapshot(FlowExecution flowExecution)
                                     throws SnapshotCreationException
Description copied from interface: FlowExecutionSnapshotFactory
Takes a snapshot of the flow execution.

Specified by:
createSnapshot in interface FlowExecutionSnapshotFactory
Parameters:
flowExecution - the flow execution
Returns:
the new snapshot
Throws:
SnapshotCreationException - if the snapshot could not be created

restoreExecution

public FlowExecution restoreExecution(FlowExecutionSnapshot snapshot,
                                      java.lang.String flowId,
                                      FlowExecutionKey key,
                                      MutableAttributeMap conversationScope,
                                      FlowExecutionKeyFactory keyFactory)
                               throws FlowExecutionRestorationFailureException
Description copied from interface: FlowExecutionSnapshotFactory
Restores a flow execution from a previously taken snapshot.

Specified by:
restoreExecution in interface FlowExecutionSnapshotFactory
Parameters:
snapshot - the previously taken snapshot
flowId - the id of the root flow definition
key - the flow execution key
conversationScope - conversation scope
keyFactory - factory for creating new snapshot keys
Returns:
the restored flow execution
Throws:
FlowExecutionRestorationFailureException - if flow execution restoration fails