|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FlowExecutionRepository
Central subsystem interface responsible for the saving and restoring of flow executions, where each flow execution represents a state of an active flow definition.
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
Method Summary | |
---|---|
FlowExecutionKey |
generateKey(FlowExecution flowExecution)
Generate a unique flow execution key to be used as the persistent identifier of the flow execution. |
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 |
getNextKey(FlowExecution flowExecution,
FlowExecutionKey previousKey)
Obtain the "next" flow execution key to be used as the flow execution's persistent identity. |
FlowExecutionKey |
parseFlowExecutionKey(java.lang.String encodedKey)
Parse the string-encoded flow execution key into its object form. |
void |
putFlowExecution(FlowExecutionKey key,
FlowExecution flowExecution)
Place the FlowExecution in this repository under the provided key. |
void |
removeFlowExecution(FlowExecutionKey key)
Remove the flow execution from the repository. |
Method Detail |
---|
FlowExecutionKey generateKey(FlowExecution flowExecution) throws FlowExecutionRepositoryException
flowExecution
- the flow execution
FlowExecutionRepositoryException
- a problem occured generating the keyFlowExecutionKey getNextKey(FlowExecution flowExecution, FlowExecutionKey previousKey) throws FlowExecutionRepositoryException
flowExecution
- the flow executionpreviousKey
- the current key associated with the flow exection
FlowExecutionRepositoryException
- a problem occured generating the keyFlowExecutionLock getLock(FlowExecutionKey key) throws FlowExecutionRepositoryException
Caution: care should be made not to allow for a deadlock situation. If you acquire a lock make sure you release it when you are done.
The general pattern for safely doing work against a locked conversation follows:
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 lock
FlowExecutionRepositoryException
- a problem occured 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 aquire the lock for the keyed flow execution.
key
- the flow execution key
FlowExecutionRepositoryException
- if no flow execution was indexed with the key providedvoid putFlowExecution(FlowExecutionKey key, 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 aquire the lock for the keyed flow execution.
key
- the flow execution keyflowExecution
- the flow execution
FlowExecutionRepositoryException
- the flow execution could not be storedvoid removeFlowExecution(FlowExecutionKey key) throws FlowExecutionRepositoryException
Before calling this method, you should aquire the lock for the keyed flow execution.
key
- the flow execution key
FlowExecutionRepositoryException
- the flow execution could not be removed.FlowExecutionKey parseFlowExecutionKey(java.lang.String encodedKey) throws FlowExecutionRepositoryException
FlowExecutionKey.toString()
.
encodedKey
- the string encoded key
FlowExecutionRepositoryException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |