Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Web Flow
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.webflow.execution
Interface FlowExecutionListener

All Known Implementing Classes:
  FlowExecutionListenerAdapter, FlowFacesContextLifecycleListener, HibernateFlowExecutionListener, JpaFlowExecutionListener, SecurityFlowExecutionListener

    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 current 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.

Author:
  Keith Donald, Erwin Vervaet, Scott Andrews
See Also:
  `FlowDefinition`, `StateDefinition`, `FlowExecution`, `RequestContext`, `Event`

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)` 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` | `resuming(RequestContext context)` Called after a flow execution is successfully reactivated after pause (but before event processing).
`void` | `sessionCreating(RequestContext context, FlowDefinition definition)` Called to indicate a new flow definition session is about to be created.
`void` | `sessionEnded(RequestContext context, FlowSession session, java.lang.String outcome, AttributeMap output)` Called when a flow execution session ends.
`void` | `sessionEnding(RequestContext context, FlowSession session, java.lang.String outcome, 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, FlowSession session, MutableAttributeMap input)` Called after a new flow session has been created but before it starts.
`void` | `stateEntered(RequestContext context, StateDefinition previousState, StateDefinition state)` Called when a state transitions, after the transition occurred.
`void` | `stateEntering(RequestContext context, StateDefinition state)` Called when a state transitions, after the transition is matched but before the transition occurs.
`void` | `transitionExecuting(RequestContext context, TransitionDefinition transition)` Called when a transition is matched but before the transition occurs.
`void` | `viewRendered(RequestContext context, View view, StateDefinition viewState)` Called after a view has completed rendering.
`void` | `viewRendering(RequestContext context, View view, StateDefinition viewState)` Called when a view is about to render in a view-state, before any render actions are executed.

Method Detail

### requestSubmitted

    void requestSubmitted(RequestContext context)

  Called when any client request is submitted to manipulate this flow execution. This call happens before request processing.

  Parameters:
    `context` - the current flow request context

### requestProcessed

    void requestProcessed(RequestContext context)

  Called when a client request has completed processing.

  Parameters:
    `context` - the source of the event

### sessionCreating

    void sessionCreating(RequestContext context,
                         FlowDefinition definition)

  Called to indicate a new flow definition session is about to be created. Called before the session is created. An exception may be thrown from this method to veto the start operation. Any type of runtime exception can be used for this purpose.

  Parameters:
    `context` - the current flow request context
    `definition` - the flow for which a new session is starting

### sessionStarting

    void sessionStarting(RequestContext context,
                         FlowSession session,
                         MutableAttributeMap input)

  Called after a new flow session has been created but before it starts. Useful for setting arbitrary attributes in the session before the flow starts.

  Parameters:
    `context` - the current flow request context
    `session` - the session that was created
    `input` - a mutable input map - attributes placed in this map are eligible for input mapping by the flow definition at startup

### sessionStarted

    void sessionStarted(RequestContext context,
                        FlowSession session)

  Called after a new flow session has started. At this point the flow's start state has been entered and any other startup behaviors have been executed.

  Parameters:
    `context` - the current flow request context
    `session` - the session that was started

### eventSignaled

    void eventSignaled(RequestContext context,
                       Event event)

  Called when an event is signaled in the current state, but prior to any state transition.

  Parameters:
    `context` - the current flow request context
    `event` - the event that occurred

### transitionExecuting

    void transitionExecuting(RequestContext context,
                             TransitionDefinition transition)

  Called when a transition is matched but before the transition occurs.

  Parameters:
    `context` - the current flow request context
    `transition` - the proposed transition

### stateEntering

    void stateEntering(RequestContext context,
                       StateDefinition state)
                       throws EnterStateVetoException

  Called when a state transitions, after the transition is matched but before the transition occurs.

  Parameters:
    `context` - the current flow request context
    `state` - the proposed state to transition to
  Throws:
    `EnterStateVetoException` - when entering the state is not allowed

### stateEntered

    void stateEntered(RequestContext context,
                      StateDefinition previousState,
                      StateDefinition state)

  Called when a state transitions, after the transition occurred.

  Parameters:
    `context` - the current flow request context
    `previousState` - from state of the transition
    `state` - to state of the transition

### viewRendering

    void viewRendering(RequestContext context,
                       View view,
                       StateDefinition viewState)

  Called when a view is about to render in a view-state, before any render actions are executed.

  Parameters:
    `context` - the current flow request context
    `view` - the view that is about to render
    `viewState` - the current view state

### viewRendered

    void viewRendered(RequestContext context,
                      View view,
                      StateDefinition viewState)

  Called after a view has completed rendering.

  Parameters:
    `context` - the current flow request context
    `view` - the view that rendered
    `viewState` - the current view state

### paused

    void paused(RequestContext context)

  Called when a flow execution is paused, for instance when it is waiting for user input (after event processing).

  Parameters:
    `context` - the current flow request context

### resuming

    void resuming(RequestContext context)

  Called after a flow execution is successfully reactivated after pause (but before event processing).

  Parameters:
    `context` - the current flow request context

### sessionEnding

    void sessionEnding(RequestContext context,
                       FlowSession session,
                       java.lang.String outcome,
                       MutableAttributeMap output)

  Called when the active flow execution session has been asked to end but before it has ended.

  Parameters:
    `context` - the current flow request context
    `session` - the current active session that is ending
    `outcome` - the outcome reached by the ending session, generally the id of the terminating end-state
    `output` - the flow output produced by the ending session, this map may be modified by this listener to affect the output returned

### sessionEnded

    void sessionEnded(RequestContext context,
                      FlowSession session,
                      java.lang.String outcome,
                      AttributeMap output)

  Called when a flow execution session ends. If the ended session was the root session of the flow execution, the entire flow execution also ends.

  Parameters:
    `context` - the current flow request context
    `session` - ending flow session
    `outcome` - the outcome reached by the ended session, generally the id of the terminating end-state
    `output` - the flow output returned by the ending session

### exceptionThrown

    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`.

  Parameters:
    `context` - the current flow request context
    `exception` - the exception that occurred

Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Web Flow
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD