|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FlowExecutionListener
Interface to be implemented by objects that wish to listen and respond to the lifecycle of
flow executions
.
An 'observer' that is very aspect like, allowing you to insert 'cross cutting' behavior at well-defined points within one or more well-defined flow execution lifecycles.
For example, one custom listener may apply security checks at the flow execution level, preventing a flow from starting or a state from entering if the curent user does not have the necessary permissions. Another listener may track flow execution navigation history to support bread crumbs. Another may perform auditing, or setup and tear down connections to a transactional resource.
Note that flow execution listeners are registered with a flow execution when that execution is created by a
factory
or restored by a
FlowExecutionRepository
. Typically a listener will not be
registered with a flow execution at runtime, when the flow execution is already active.
FlowDefinition
,
StateDefinition
,
FlowExecution
,
RequestContext
,
Event
,
ViewSelection
Method Summary | |
---|---|
void |
eventSignaled(RequestContext context,
Event event)
Called when an event is signaled in the current state, but prior to any state transition. |
void |
exceptionThrown(RequestContext context,
FlowExecutionException exception)
Called when an exception is thrown during a flow execution, before the exception is handled by any registered handler . |
void |
paused(RequestContext context,
ViewSelection selectedView)
Called when a flow execution is paused, for instance when it is waiting for user input (after event processing). |
void |
requestProcessed(RequestContext context)
Called when a client request has completed processing. |
void |
requestSubmitted(RequestContext context)
Called when any client request is submitted to manipulate this flow execution. |
void |
resumed(RequestContext context)
Called after a flow execution is successfully reactivated after pause (but before event processing). |
void |
sessionCreated(RequestContext context,
FlowSession session)
Called after a new flow session has been created but before it starts. |
void |
sessionEnded(RequestContext context,
FlowSession session,
AttributeMap output)
Called when a flow execution session ends. |
void |
sessionEnding(RequestContext context,
FlowSession session,
MutableAttributeMap output)
Called when the active flow execution session has been asked to end but before it has ended. |
void |
sessionStarted(RequestContext context,
FlowSession session)
Called after a new flow session has started. |
void |
sessionStarting(RequestContext context,
FlowDefinition definition,
MutableAttributeMap input)
Called to indicate a new flow definition session is about to be created and started. |
void |
stateEntered(RequestContext context,
StateDefinition previousState,
StateDefinition state)
Called when a state transitions, after the transition occured. |
void |
stateEntering(RequestContext context,
StateDefinition state)
Called when a state transitions, after the transition is matched but before the transition occurs. |
Method Detail |
---|
void requestSubmitted(RequestContext context)
context
- the source of the eventvoid requestProcessed(RequestContext context)
context
- the source of the eventvoid sessionStarting(RequestContext context, FlowDefinition definition, MutableAttributeMap input)
context
- the source of the eventdefinition
- the flow for which a new session is startinginput
- a mutable input map - attributes placed in this map are eligible for input mapping by the flow
definition at startupvoid sessionCreated(RequestContext context, FlowSession session)
context
- the source of the eventsession
- the session that was createdvoid sessionStarted(RequestContext context, FlowSession session)
context
- the source of the eventsession
- the session that was startedvoid eventSignaled(RequestContext context, Event event)
context
- the source of the eventevent
- the event that occuredvoid stateEntering(RequestContext context, StateDefinition state) throws EnterStateVetoException
context
- the source of the eventstate
- the proposed state to transition to
EnterStateVetoException
- when entering the state is not allowedvoid stateEntered(RequestContext context, StateDefinition previousState, StateDefinition state)
context
- the source of the eventpreviousState
- from state of the transitionstate
- to state of the transitionvoid paused(RequestContext context, ViewSelection selectedView)
context
- the source of the eventselectedView
- the view that will displayvoid resumed(RequestContext context)
context
- the source of the eventvoid sessionEnding(RequestContext context, FlowSession session, MutableAttributeMap output)
context
- the source of the eventsession
- the current active session that is endingoutput
- the flow output produced by the ending session, this map may be modified by this listener to affect
the output returnedvoid sessionEnded(RequestContext context, FlowSession session, AttributeMap output)
context
- the source of the eventsession
- ending flow sessionoutput
- final, unmodifiable output returned by the ended sessionvoid exceptionThrown(RequestContext context, FlowExecutionException exception)
handler
.
context
- the source of the exceptionexception
- the exception that occurred
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |