org.sakaiproject.jsf.component
Class FlowState

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byorg.sakaiproject.jsf.component.FlowState
All Implemented Interfaces:
StateHolder

public class FlowState
extends UIComponentBase

This JSF UI component lets backing beans track the request life cycle and save their state within the component tree itself. (These two aspects could be separated with a "saveState" Boolean attribute if we ever need to let a session-scoped bean track the request life cycle.) Like the MyFaces x:saveState tag, this passes the bean's state from request to request without use of session scope. That in turn enables request-thread functionality such as "what if?" scenarios and multiple active application views from a single session.

Usage: <sakaix:flowState bean="#{phaseAwareBean}" /> should be placed in the JSP file before any other bean references are made.

The bean must implement the PhaseAware interface and be serializable. Any non-transient fields in the bean will be saved and restored from this component.


Field Summary
static String COMPONENT_TYPE
           
 
Constructor Summary
FlowState()
           
 
Method Summary
 void encodeBegin(FacesContext context)
           
 PhaseAware getBean()
           
 String getFamily()
           
 void processDecodes(FacesContext context)
           
 void processRestoreState(FacesContext context, Object state)
           
 void processUpdates(FacesContext context)
           
 void processValidators(FacesContext context)
           
 void restoreState(FacesContext context, Object state)
           
 Object saveState(FacesContext context)
           
 void setBean(PhaseAware bean)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

FlowState

public FlowState()
Method Detail

setBean

public void setBean(PhaseAware bean)

getBean

public PhaseAware getBean()

saveState

public Object saveState(FacesContext context)

restoreState

public void restoreState(FacesContext context,
                         Object state)

processRestoreState

public void processRestoreState(FacesContext context,
                                Object state)

processDecodes

public void processDecodes(FacesContext context)

processValidators

public void processValidators(FacesContext context)

processUpdates

public void processUpdates(FacesContext context)

encodeBegin

public void encodeBegin(FacesContext context)
                 throws IOException
Throws:
IOException

getFamily

public String getFamily()