org.springframework.webflow.executor.jsf
Class FlowPhaseListener

java.lang.Object
  extended by org.springframework.webflow.executor.jsf.FlowPhaseListener
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.faces.event.PhaseListener

public class FlowPhaseListener
extends java.lang.Object
implements javax.faces.event.PhaseListener

JSF phase listener that is responsible for managing a FlowExecution object representing an active user conversation so that other JSF artifacts that execute in different phases of the JSF lifecycle may have access to it.

This phase listener implements the following algorithm:

Author:
Colin Sampaleanu, Keith Donald
See Also:
Serialized Form

Nested Class Summary
static class FlowPhaseListener.DefaultViewIdMapper
          Standard default view id resolver which uses the web flow view name as the jsf view id
 
Field Summary
protected  org.apache.commons.logging.Log logger
          Logger, usable by subclasses.
 
Constructor Summary
FlowPhaseListener()
           
 
Method Summary
 void afterPhase(javax.faces.event.PhaseEvent event)
           
 void beforePhase(javax.faces.event.PhaseEvent event)
           
protected  LocalAttributeMap createInput(FlowExecution flowExecution, ExternalContext context)
          Factory method that creates the input attribute map for a newly created FlowExecution.
 FlowExecutorArgumentHandler getArgumentHandler()
          Returns the argument handler used by this phase listener.
 javax.faces.event.PhaseId getPhaseId()
           
 ViewIdMapper getViewIdMapper()
          Returns the JSF view id resolver used by this phase listener.
protected  void prepareApplicationView(javax.faces.context.FacesContext facesContext, FlowExecutionHolder holder)
           
protected  void prepareResponse(JsfExternalContext context, FlowExecutionHolder holder)
           
protected  void restoreFlowExecution(javax.faces.context.FacesContext facesContext)
           
protected  void saveFlowExecution(JsfExternalContext context, FlowExecutionHolder holder)
           
 void setArgumentHandler(FlowExecutorArgumentHandler argumentHandler)
          Sets the argument handler to use.
 void setViewIdMapper(ViewIdMapper viewIdMapper)
          Sets the JSF view id mapper used by this phase listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger, usable by subclasses.

Constructor Detail

FlowPhaseListener

public FlowPhaseListener()
Method Detail

getArgumentHandler

public FlowExecutorArgumentHandler getArgumentHandler()
Returns the argument handler used by this phase listener.


setArgumentHandler

public void setArgumentHandler(FlowExecutorArgumentHandler argumentHandler)
Sets the argument handler to use.


getViewIdMapper

public ViewIdMapper getViewIdMapper()
Returns the JSF view id resolver used by this phase listener.


setViewIdMapper

public void setViewIdMapper(ViewIdMapper viewIdMapper)
Sets the JSF view id mapper used by this phase listener.


getPhaseId

public javax.faces.event.PhaseId getPhaseId()
Specified by:
getPhaseId in interface javax.faces.event.PhaseListener

beforePhase

public void beforePhase(javax.faces.event.PhaseEvent event)
Specified by:
beforePhase in interface javax.faces.event.PhaseListener

afterPhase

public void afterPhase(javax.faces.event.PhaseEvent event)
Specified by:
afterPhase in interface javax.faces.event.PhaseListener

restoreFlowExecution

protected void restoreFlowExecution(javax.faces.context.FacesContext facesContext)

createInput

protected LocalAttributeMap createInput(FlowExecution flowExecution,
                                        ExternalContext context)
Factory method that creates the input attribute map for a newly created FlowExecution. TODO - add support for input mappings here

Parameters:
flowExecution - the new flow execution (yet to be started)
context - the external context
Returns:
the input map

prepareResponse

protected void prepareResponse(JsfExternalContext context,
                               FlowExecutionHolder holder)

prepareApplicationView

protected void prepareApplicationView(javax.faces.context.FacesContext facesContext,
                                      FlowExecutionHolder holder)

saveFlowExecution

protected void saveFlowExecution(JsfExternalContext context,
                                 FlowExecutionHolder holder)


Copyright © 2004-2006. All Rights Reserved.