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

java.lang.Object
  extended by org.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository
      extended by org.springframework.webflow.execution.repository.snapshot.AbstractSnapshottingFlowExecutionRepository
All Implemented Interfaces:
FlowExecutionKeyFactory, FlowExecutionRepository
Direct Known Subclasses:
DefaultFlowExecutionRepository

public abstract class AbstractSnapshottingFlowExecutionRepository
extends AbstractFlowExecutionRepository

Base class for repositories that take flow execution snapshots using a FlowExecutionSnapshotFactory.

Author:
Keith Donald

Field Summary
 
Fields inherited from class org.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository
logger
 
Constructor Summary
AbstractSnapshottingFlowExecutionRepository(ConversationManager conversationManager, FlowExecutionSnapshotFactory snapshotFactory)
          Creates a new snapshotting flow execution repository.
 
Method Summary
 FlowExecutionSnapshotFactory getSnapshotFactory()
          Returns the configured flow execution snapshot factory.
protected  java.io.Serializable getSnapshotId(FlowExecutionKey key)
          Returns the snapshotId portion of the flow execution key.
protected  void putConversationScope(FlowExecution flowExecution, Conversation conversation)
          Puts the value of conversation scope in the conversation object.
protected  FlowExecution restoreFlowExecution(FlowExecutionSnapshot snapshot, FlowExecutionKey key, Conversation conversation)
          Restore a flow execution from a snapshot.
protected  FlowExecutionSnapshot snapshot(FlowExecution flowExecution)
          Take a new flow execution snapshot.
 
Methods inherited from class org.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository
assertKeySet, createConversationParameters, getAlwaysGenerateNewNextKey, getConversation, getConversation, getConversationManager, getFlowExecution, getKey, getLock, nextSnapshotId, parseFlowExecutionKey, putFlowExecution, removeFlowExecution, setAlwaysGenerateNewNextKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.webflow.execution.FlowExecutionKeyFactory
removeAllFlowExecutionSnapshots, removeFlowExecutionSnapshot, updateFlowExecutionSnapshot
 

Constructor Detail

AbstractSnapshottingFlowExecutionRepository

public AbstractSnapshottingFlowExecutionRepository(ConversationManager conversationManager,
                                                   FlowExecutionSnapshotFactory snapshotFactory)
Creates a new snapshotting flow execution repository.

Parameters:
conversationManager - the conversation manager
snapshotFactory - the execution snapshot factory
Method Detail

getSnapshotFactory

public FlowExecutionSnapshotFactory getSnapshotFactory()
Returns the configured flow execution snapshot factory.

Returns:
the snapshot factory

getSnapshotId

protected java.io.Serializable getSnapshotId(FlowExecutionKey key)
Returns the snapshotId portion of the flow execution key.

Parameters:
key - the execution key

snapshot

protected FlowExecutionSnapshot snapshot(FlowExecution flowExecution)
Take a new flow execution snapshot.

Parameters:
flowExecution - the execution to snapshot
Returns:
the snapshot

restoreFlowExecution

protected FlowExecution restoreFlowExecution(FlowExecutionSnapshot snapshot,
                                             FlowExecutionKey key,
                                             Conversation conversation)
Restore a flow execution from a snapshot.

Parameters:
snapshot - the snapshot
key - the flow execution snapshot key
conversation - the governing conversation
Returns:
the restored flow execution

putConversationScope

protected void putConversationScope(FlowExecution flowExecution,
                                    Conversation conversation)
Puts the value of conversation scope in the conversation object.

Parameters:
flowExecution - the flow execution holding a reference to conversation scope
conversation - the conversation where conversation scope is stored