public interface FlowExecutionRepository
Flow execution repositories are responsible for managing the storage, restoration and removal of flow executions launched by clients of the Spring Web Flow system.
When placed in a repository a FlowExecution
object representing the state of a flow at a point in time is
indexed under a unique FlowExecutionKey
.
FlowExecution
,
FlowExecutionKey
Modifier and Type | Method and Description |
---|---|
FlowExecution |
getFlowExecution(FlowExecutionKey key)
Return the
FlowExecution indexed by the provided key. |
FlowExecutionLock |
getLock(FlowExecutionKey key)
Return the lock for the flow execution, allowing for the lock to be acquired or released.
|
FlowExecutionKey |
parseFlowExecutionKey(java.lang.String encodedKey)
Parse the string-encoded flow execution key into its object form.
|
void |
putFlowExecution(FlowExecution flowExecution)
Place the
FlowExecution in this repository under the provided key. |
void |
removeFlowExecution(FlowExecution flowExecution)
Remove the flow execution from the repository.
|
FlowExecutionKey parseFlowExecutionKey(java.lang.String encodedKey) throws FlowExecutionRepositoryException
FlowExecutionKey.toString()
.encodedKey
- the string encoded keyFlowExecutionRepositoryException
FlowExecutionLock getLock(FlowExecutionKey key) throws FlowExecutionRepositoryException
FlowExecutionLock lock = repository.getLock(key); lock.lock(); try { FlowExecution execution = repository.getFlowExecution(key); // do work } finally { lock.unlock(); }
key
- the identifier of the flow execution to lockFlowExecutionRepositoryException
- a problem occurred accessing the lock objectFlowExecution getFlowExecution(FlowExecutionKey key) throws FlowExecutionRepositoryException
FlowExecution
indexed by the provided key. The returned flow execution represents the
restored state of an executing flow from a point in time. This should be called to resume a persistent flow
execution. Before calling this method, you should acquire the lock for the keyed flow execution.key
- the flow execution keyFlowExecutionRepositoryException
- if no flow execution was indexed with the key providedvoid putFlowExecution(FlowExecution flowExecution) throws FlowExecutionRepositoryException
FlowExecution
in this repository under the provided key. This should be called to save
or update the persistent state of an active (but paused) flow execution. Before calling this method, you should
acquire the lock for the keyed flow execution.flowExecution
- the flow executionFlowExecutionRepositoryException
- the flow execution could not be storedvoid removeFlowExecution(FlowExecution flowExecution) throws FlowExecutionRepositoryException
flowExecution
- the flow executionFlowExecutionRepositoryException
- the flow execution could not be removed.