Spring Web Flow

org.springframework.webflow.test
Class MockFlowExecutionKeyFactory

java.lang.Object
  extended by org.springframework.webflow.test.MockFlowExecutionKeyFactory
All Implemented Interfaces:
FlowExecutionKeyFactory

public class MockFlowExecutionKeyFactory
extends java.lang.Object
implements FlowExecutionKeyFactory

Trivial flow execution key factory implementation that returns a mock flow execution key each time. The mock key returned is unique: its value is the result of incrementing a sequence managed in static memory.

Author:
Keith Donald

Constructor Summary
MockFlowExecutionKeyFactory()
           
 
Method Summary
 FlowExecutionKey getKey(FlowExecution execution)
          Get the key to assign to the flow execution.
 void removeAllFlowExecutionSnapshots(FlowExecution execution)
          Remove all snapshots associated with the flow execution from storage, invalidating all history.
 void removeFlowExecutionSnapshot(FlowExecution execution)
          Remove the snapshot that was used to restore this flow execution, discarding it for future use.
 void updateFlowExecutionSnapshot(FlowExecution execution)
          Capture the current state of the flow execution by updating its snapshot in storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockFlowExecutionKeyFactory

public MockFlowExecutionKeyFactory()
Method Detail

getKey

public FlowExecutionKey getKey(FlowExecution execution)
Description copied from interface: FlowExecutionKeyFactory
Get the key to assign to the flow execution. This factory simply generates the key to assign, it does not actually perform the key assignment.

Specified by:
getKey in interface FlowExecutionKeyFactory
Parameters:
execution - the flow execution
Returns:
the key to assign to the flow execution

removeAllFlowExecutionSnapshots

public void removeAllFlowExecutionSnapshots(FlowExecution execution)
Description copied from interface: FlowExecutionKeyFactory
Remove all snapshots associated with the flow execution from storage, invalidating all history. Does nothing if no key has been assigned or no snapshots have been taken.

Specified by:
removeAllFlowExecutionSnapshots in interface FlowExecutionKeyFactory
Parameters:
execution - the flow execution

removeFlowExecutionSnapshot

public void removeFlowExecutionSnapshot(FlowExecution execution)
Description copied from interface: FlowExecutionKeyFactory
Remove the snapshot that was used to restore this flow execution, discarding it for future use. Does nothing if the no key been assigned or no snapshot has been taken.

Specified by:
removeFlowExecutionSnapshot in interface FlowExecutionKeyFactory
Parameters:
execution - the flow execution

updateFlowExecutionSnapshot

public void updateFlowExecutionSnapshot(FlowExecution execution)
Description copied from interface: FlowExecutionKeyFactory
Capture the current state of the flow execution by updating its snapshot in storage. Does nothing if the no key has been assigned or no snapshot has already been taken.

Specified by:
updateFlowExecutionSnapshot in interface FlowExecutionKeyFactory
Parameters:
execution - the flow execution

Spring Web Flow