|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository
public abstract class AbstractFlowExecutionRepository
Abstract base class for flow execution repository implementations. Does not make any assumptions about the storage
medium used to store active flow executions. Mandates the use of a FlowExecutionStateRestorer
, used to
rehydrate a flow execution after it has been obtained from storage from resume.
The configured FlowExecutionStateRestorer
should be compatible with the chosen FlowExecution
implementation and its FlowExecutionFactory
.
Method Summary | |
---|---|
boolean |
getAlwaysGenerateNewNextKey()
The flag indicating if a new FlowExecutionKey should always be generated before each put call. |
ConversationManager |
getConversationManager()
The conversation service to delegate to for managing conversations initiated by this repository. |
abstract FlowExecution |
getFlowExecution(FlowExecutionKey key)
Return the FlowExecution indexed by the provided key. |
FlowExecutionKey |
getKey(FlowExecution execution)
Get the key to assign to the flow execution. |
FlowExecutionLock |
getLock(FlowExecutionKey key)
Return the lock for the flow execution, allowing for the lock to be acquired or released. |
FlowExecutionKey |
parseFlowExecutionKey(String encodedKey)
Parse the string-encoded flow execution key into its object form. |
abstract 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. |
void |
setAlwaysGenerateNewNextKey(boolean alwaysGenerateNewNextKey)
Sets the flag indicating if a new FlowExecutionKey should always be generated before each put call. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.webflow.execution.FlowExecutionKeyFactory |
---|
removeAllFlowExecutionSnapshots, removeFlowExecutionSnapshot, updateFlowExecutionSnapshot |
Method Detail |
---|
public ConversationManager getConversationManager()
public boolean getAlwaysGenerateNewNextKey()
FlowExecutionKey
should always be generated before each put call.
public void setAlwaysGenerateNewNextKey(boolean alwaysGenerateNewNextKey)
FlowExecutionKey
should always be generated before each put call. By
setting this to false a FlowExecution can remain identified by the same key throughout its life.
public FlowExecutionKey getKey(FlowExecution execution)
FlowExecutionKeyFactory
getKey
in interface FlowExecutionKeyFactory
execution
- the flow execution
public FlowExecutionKey parseFlowExecutionKey(String encodedKey) throws FlowExecutionRepositoryException
FlowExecutionRepository
FlowExecutionKey.toString()
.
parseFlowExecutionKey
in interface FlowExecutionRepository
encodedKey
- the string encoded key
FlowExecutionRepositoryException
public FlowExecutionLock getLock(FlowExecutionKey key) throws FlowExecutionRepositoryException
FlowExecutionRepository
FlowExecutionLock lock = repository.getLock(key); lock.lock(); try { FlowExecution execution = repository.getFlowExecution(key); // do work } finally { lock.unlock(); }
getLock
in interface FlowExecutionRepository
key
- the identifier of the flow execution to lock
FlowExecutionRepositoryException
- a problem occurred accessing the lock objectpublic void removeFlowExecution(FlowExecution flowExecution) throws FlowExecutionRepositoryException
FlowExecutionRepository
removeFlowExecution
in interface FlowExecutionRepository
flowExecution
- the flow execution
FlowExecutionRepositoryException
- the flow execution could not be removed.public abstract FlowExecution getFlowExecution(FlowExecutionKey key) throws FlowExecutionRepositoryException
FlowExecutionRepository
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.
getFlowExecution
in interface FlowExecutionRepository
key
- the flow execution key
FlowExecutionRepositoryException
- if no flow execution was indexed with the key providedpublic abstract void putFlowExecution(FlowExecution flowExecution) throws FlowExecutionRepositoryException
FlowExecutionRepository
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.
putFlowExecution
in interface FlowExecutionRepository
flowExecution
- the flow execution
FlowExecutionRepositoryException
- the flow execution could not be stored
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |