|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.webflow.execution.FlowExecutionManager
public class FlowExecutionManager
A manager for the executing flows of the application. This object is responsible for creating new flow executions as requested by the client, as well as signaling events for processing by existing, paused executions (that are waiting to be resumed in response to a user event).
The onEvent(Event) method implements the following algorithm:
By default, this class will use the flow execution implementation provided
by the FlowExecutionImpl class. If you would like to use a
different implementation, just override the createFlowExecution(Flow)
method in a subclass.
FlowExecution,
FlowExecutionStorage| Field Summary | |
|---|---|
static java.lang.String |
CURRENT_STATE_ID_ATTRIBUTE
The current state of the flow execution will be exposed to the view in a model attribute with this name ("currentStateId"). |
static java.lang.String |
FLOW_EXECUTION_CONTEXT_ATTRIBUTE
The flow context itself will be exposed to the view in a model attribute with this name ("flowExecutionContext"). |
static java.lang.String |
FLOW_EXECUTION_ID_ATTRIBUTE
The id of the flow execution will be exposed to the view in a model attribute with this name ("flowExecutionId"). |
static java.lang.String |
FLOW_EXECUTION_ID_PARAMETER
Clients can send the flow execution id using an event parameter with this name ("_flowExecutionId"). |
static java.lang.String |
FLOW_ID_PARAMETER
Clients can send the id (name) of the flow to be started using an event parameter with this name ("_flowId"). |
protected org.apache.commons.logging.Log |
logger
|
static java.lang.String |
NOT_SET_EVENT_ID
Event id value indicating that the event has not been set ("@NOT_SET@"). |
| Constructor Summary | |
|---|---|
FlowExecutionManager()
Create a new flow execution manager. |
|
| Method Summary | |
|---|---|
void |
addListener(FlowExecutionListener listener)
Add a listener that will listen to executions for all flows. |
void |
addListener(FlowExecutionListener listener,
FlowExecutionListenerCriteria criteria)
Add a listener that wil listen to executions to flows matching the specified criteria |
protected FlowExecution |
createFlowExecution(Flow flow)
Create a new flow execution for given flow. |
protected org.springframework.beans.factory.BeanFactory |
getBeanFactory()
Returns this flow execution manager's bean factory. |
org.springframework.binding.convert.ConversionService |
getConversionService()
Returns the conversion service used by this flow execution manager. |
protected Flow |
getFlow()
Returns the flow whose executions are managed by this manager. |
protected Flow |
getFlow(Event event)
Obtain a flow to use from given event. |
protected java.lang.String |
getFlowExecutionId(Event event)
Obtain a unique flow execution id from given event. |
protected java.lang.String |
getFlowExecutionIdParameterName()
Returns the name of the flow execution id parameter in the event ("_flowExecutionId"). |
protected java.lang.String |
getFlowIdParameterName()
Returns the name of the flow id parameter in the event ("_flowId"). |
protected FlowLocator |
getFlowLocator()
Returns the flow locator to use for lookup of flows specified using the "_flowId" event parameter. |
FlowExecutionListener[] |
getListeners(Flow flow)
Returns the array of flow execution listeners for specified flow. |
protected java.lang.String |
getNotSetEventIdParameterMarker()
Returns the marker value indicating that the event id parameter was not set properly in the event because of a view configuration error ("@NOT_SET@"). |
protected FlowExecutionStorage |
getStorage()
Returns the storage strategy used by the flow execution manager. |
protected TransactionSynchronizer |
getTransactionSynchronizer()
Return the application transaction synchronization strategy to use. |
ViewDescriptor |
onEvent(Event event)
Signal the occurence of the specified event - this is the entry point into the webflow system for managing all executing flows. |
ViewDescriptor |
onEvent(Event event,
FlowExecutionListener listener)
Signal the occurence of the specified event - this is the entry point into the webflow system for managing all executing flows. |
protected ViewDescriptor |
prepareViewDescriptor(ViewDescriptor viewDescriptor,
java.io.Serializable flowExecutionId,
FlowExecutionContext flowExecutionContext)
Do any processing necessary before given view descriptor can be returned to the client of the flow execution manager. |
void |
removeListener(FlowExecutionListener listener)
Remove the flow execution listener from the listener list. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
void |
setConversionService(org.springframework.binding.convert.ConversionService conversionService)
Set the conversion service used by this flow execution manager. |
void |
setFlow(Flow flow)
Set the flow whose executions will be managed if there is no alternate flow id specified in a "_flowId" event parameter. |
void |
setFlowLocator(FlowLocator flowLocator)
Set the flow locator to use for lookup of flows specified using the "_flowId" event parameter. |
void |
setListener(FlowExecutionListener listener)
Set the flow execution listener that will be notified of managed flow executions. |
void |
setListener(FlowExecutionListener listener,
FlowExecutionListenerCriteria criteria)
Set the flow execution listener that will be notified of managed flow executions for the flows that match given criteria. |
void |
setListenerMap(java.util.Map listenerCriteriaMap)
Sets the flow execution listeners that will be notified of managed flow executions. |
void |
setListeners(java.util.Collection listeners)
Sets the flow execution listeners that will be notified of managed flow executions. |
void |
setListeners(java.util.Collection listeners,
FlowExecutionListenerCriteria criteria)
Sets the flow execution listeners that will be notified of managed flow executions for flows that match given criteria. |
void |
setStorage(FlowExecutionStorage storage)
Set the storage strategy used by the flow execution manager. |
void |
setTransactionSynchronizer(TransactionSynchronizer transactionSynchronizer)
Set the application transaction synchronization strategy to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FLOW_ID_PARAMETER
public static final java.lang.String FLOW_EXECUTION_ID_PARAMETER
public static final java.lang.String FLOW_EXECUTION_ID_ATTRIBUTE
public static final java.lang.String FLOW_EXECUTION_CONTEXT_ATTRIBUTE
public static final java.lang.String CURRENT_STATE_ID_ATTRIBUTE
public static final java.lang.String NOT_SET_EVENT_ID
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public FlowExecutionManager()
setFlow(Flow),
setFlowLocator(FlowLocator),
setListener(FlowExecutionListener),
setListener(FlowExecutionListener, FlowExecutionListenerCriteria),
setListenerMap(Map),
setListeners(Collection),
setListeners(Collection, FlowExecutionListenerCriteria),
setStorage(FlowExecutionStorage),
setTransactionSynchronizer(TransactionSynchronizer),
setConversionService(ConversionService)| Method Detail |
|---|
protected Flow getFlow()
null if there is no preconfigured flow and
the id of the flow for which executions will be managed is sent
in an event parameter "_flowId".
public void setFlow(Flow flow)
protected FlowLocator getFlowLocator()
public void setFlowLocator(FlowLocator flowLocator)
public FlowExecutionListener[] getListeners(Flow flow)
getListeners in interface FlowExecutionListenerLoaderflow - the flow definition associated with the execution to be listened to
public void setListener(FlowExecutionListener listener)
public void setListener(FlowExecutionListener listener,
FlowExecutionListenerCriteria criteria)
public void setListeners(java.util.Collection listeners)
public void setListeners(java.util.Collection listeners,
FlowExecutionListenerCriteria criteria)
public void setListenerMap(java.util.Map listenerCriteriaMap)
FlowExecutionListenerCriteria objects.
public void addListener(FlowExecutionListener listener)
listener - the listener to add
public void addListener(FlowExecutionListener listener,
FlowExecutionListenerCriteria criteria)
listener - the listenercriteria - the listener criteriapublic void removeListener(FlowExecutionListener listener)
listener - the listenerprotected FlowExecutionStorage getStorage()
public void setStorage(FlowExecutionStorage storage)
protected TransactionSynchronizer getTransactionSynchronizer()
FlowScopeTokenTransactionSynchronizer.
public void setTransactionSynchronizer(TransactionSynchronizer transactionSynchronizer)
public org.springframework.binding.convert.ConversionService getConversionService()
public void setConversionService(org.springframework.binding.convert.ConversionService conversionService)
protected org.springframework.beans.factory.BeanFactory getBeanFactory()
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansException
public ViewDescriptor onEvent(Event event)
throws java.lang.Exception
event - the event that occured
java.lang.Exception - in case of errors
public ViewDescriptor onEvent(Event event,
FlowExecutionListener listener)
throws java.lang.Exception
event - the event that occuredlistener - a listener interested in flow execution
lifecycle events that happen while handling this event
java.lang.Exception - in case of errorsprotected FlowExecution createFlowExecution(Flow flow)
flow - the flow
protected Flow getFlow(Event event)
protected java.lang.String getFlowIdParameterName()
protected java.lang.String getFlowExecutionId(Event event)
event - the event
null if not foundprotected java.lang.String getFlowExecutionIdParameterName()
protected java.lang.String getNotSetEventIdParameterMarker()
This is useful when a view relies on an dynamic means to set the eventId event parameter, for example, using javascript. This approach assumes the "not set" marker value will be a static default (a kind of fallback, submitted if the eventId does not get set to the proper dynamic value onClick, for example, if javascript was disabled).
protected ViewDescriptor prepareViewDescriptor(ViewDescriptor viewDescriptor,
java.io.Serializable flowExecutionId,
FlowExecutionContext flowExecutionContext)
FLOW_EXECUTION_CONTEXT_ATTRIBUTE, FLOW_EXECUTION_ID_ATTRIBUTE
and CURRENT_STATE_ID_ATTRIBUTE.
viewDescriptor - the view descriptor to be processedflowExecutionId - the unique id of the flow executionflowExecutionContext - the flow context providing info about the flow execution
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||