|
||||||||||
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
org.springframework.webflow.execution.repository.support.AbstractConversationFlowExecutionRepository
org.springframework.webflow.execution.repository.support.SimpleFlowExecutionRepository
public class SimpleFlowExecutionRepository
Conversation manager based flow execution repository that stores exactly one flow execution per conversation.
It is important to note that by default use of this repository does not allow for duplicate submission in
conjunction with browser navigational buttons (such as the back button). Specifically, if you attempt to "go back"
and resubmit, the continuation id stored on the page in your browser history will not match the continuation
id of the flow execution entry and access to the conversation will be disallowed. This is because the
continuationId
changes on each request to consistently prevent the possibility of duplicate submission (setAlwaysGenerateNewNextKey(boolean)
).
This repository is specifically designed to be 'simple': incurring minimal resources and overhead, as only one
FlowExecution
is stored per conversation. This repository implementation should only be used when you
do not have to support browser navigational button use, e.g. you lock down the browser and require that all
navigational events to be routed explicitly through Spring Web Flow.
Field Summary |
---|
Fields inherited from class org.springframework.webflow.execution.repository.support.AbstractConversationFlowExecutionRepository |
---|
logger |
Constructor Summary | |
---|---|
SimpleFlowExecutionRepository(FlowExecutionStateRestorer executionStateRestorer,
ConversationManager conversationManager)
Create a new simple repository using given state restorer and conversation manager. |
Method Summary | |
---|---|
protected java.io.Serializable |
generateContinuationId(FlowExecution flowExecution)
Template method used to generate a new continuation id for given flow execution. |
UidGenerator |
getContinuationIdGenerator()
Returns the uid generation strategy used to generate continuation identifiers. |
FlowExecution |
getFlowExecution(FlowExecutionKey key)
Return the FlowExecution indexed by the provided key. |
FlowExecutionKey |
getNextKey(FlowExecution flowExecution,
FlowExecutionKey previousKey)
Obtain the "next" flow execution key to be used as the flow execution's persistent identity. |
boolean |
isAlwaysGenerateNewNextKey()
Returns whether or not a new flow execution key should always be generated before each put call. |
protected java.io.Serializable |
parseContinuationId(java.lang.String encodedId)
Template method to parse the continuation id from the encoded string. |
void |
putFlowExecution(FlowExecutionKey key,
FlowExecution flowExecution)
Place the FlowExecution in this repository under the provided key. |
void |
setAlwaysGenerateNewNextKey(boolean alwaysGenerateNewNextKey)
Sets a flag indicating if a new FlowExecutionKey should always be generated before each put call. |
void |
setContinuationIdGenerator(UidGenerator continuationIdGenerator)
Sets the uid generation strategy used to generate unique continuation identifiers for flow execution keys . |
Methods inherited from class org.springframework.webflow.execution.repository.support.AbstractConversationFlowExecutionRepository |
---|
createConversationParameters, generateKey, getContinuationId, getConversation, getConversationId, getConversationManager, getConversationScope, getLock, onBegin, onEnd, parseFlowExecutionKey, putConversationScope, removeFlowExecution |
Methods inherited from class org.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository |
---|
getExecutionStateRestorer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleFlowExecutionRepository(FlowExecutionStateRestorer executionStateRestorer, ConversationManager conversationManager)
executionStateRestorer
- the flow execution state restoration strategy to useconversationManager
- the conversation manager to useMethod Detail |
---|
public boolean isAlwaysGenerateNewNextKey()
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 UidGenerator getContinuationIdGenerator()
RandomGuidUidGenerator
.
public void setContinuationIdGenerator(UidGenerator continuationIdGenerator)
flow execution keys
.
public FlowExecutionKey getNextKey(FlowExecution flowExecution, FlowExecutionKey previousKey)
FlowExecutionRepository
getNextKey
in interface FlowExecutionRepository
getNextKey
in class AbstractConversationFlowExecutionRepository
flowExecution
- the flow executionpreviousKey
- the current key associated with the flow exectionpublic FlowExecution getFlowExecution(FlowExecutionKey key)
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 aquire the lock for the keyed flow execution.
getFlowExecution
in interface FlowExecutionRepository
getFlowExecution
in class AbstractConversationFlowExecutionRepository
key
- the flow execution key
public void putFlowExecution(FlowExecutionKey key, FlowExecution flowExecution)
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 aquire the lock for the keyed flow execution.
putFlowExecution
in interface FlowExecutionRepository
putFlowExecution
in class AbstractConversationFlowExecutionRepository
key
- the flow execution keyflowExecution
- the flow executionprotected java.io.Serializable generateContinuationId(FlowExecution flowExecution)
AbstractConversationFlowExecutionRepository
generateContinuationId
in class AbstractConversationFlowExecutionRepository
flowExecution
- the flow execution
protected java.io.Serializable parseContinuationId(java.lang.String encodedId)
AbstractConversationFlowExecutionRepository
parseContinuationId
in class AbstractConversationFlowExecutionRepository
encodedId
- the string identifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |