Class CCStateManager

java.lang.Object
javax.faces.application.StateManager
org.eclnt.jsfserver.util.CCStateManager

public class CCStateManager extends javax.faces.application.StateManager
State manager that is used within CaptainCasa. The situation is: CaptainCasa components do not hold any state (aside technical state) on their owns, the full application state is always referenced via expressions. Therefore the strategy is:

The view root is parked within the session state of the http session. Assuming that the next http request will hit the same virtual machine the view root will as consequence NOT be persisted all the time but is kept stable.

If case the session state is not available (e.g. due to session migration) the view root will be re-built out of the current page context.

What's the advantage? There is NO UIComponent state serialization with every roundtrip. So, the scenario is "optimal" if the session by default is kept up and running in a cerain application server node.

Whats's the disadvantage? If a session is migrated from one node to the next, then the current request that the user invoked will be lost (because there is no component tree to take over events and data changed - the tree is rebuilt in the rendering phase).
  • Nested Class Summary

    Nested classes/interfaces inherited from class javax.faces.application.StateManager

    javax.faces.application.StateManager.SerializedView
  • Field Summary

    Fields inherited from class javax.faces.application.StateManager

    FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME, IS_BUILDING_INITIAL_STATE, IS_SAVING_STATE, PARTIAL_STATE_SAVING_PARAM_NAME, SERIALIZE_SERVER_STATE_PARAM_NAME, STATE_SAVING_METHOD_CLIENT, STATE_SAVING_METHOD_PARAM_NAME, STATE_SAVING_METHOD_SERVER
  • Constructor Summary

    Constructors
    Constructor
    Description
    CCStateManager(javax.faces.application.StateManager parent)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Object
    getComponentStateToSave(javax.faces.context.FacesContext context)
     
    protected Object
    getTreeStructureToSave(javax.faces.context.FacesContext context)
     
    boolean
    isSavingStateInClient(javax.faces.context.FacesContext context)
     
    protected void
    restoreComponentState(javax.faces.context.FacesContext context, javax.faces.component.UIViewRoot viewRoot, String renderKitId)
     
    protected javax.faces.component.UIViewRoot
    restoreTreeStructure(javax.faces.context.FacesContext context, String viewId, String renderKitId)
     
    javax.faces.component.UIViewRoot
    restoreView(javax.faces.context.FacesContext context, String viewId, String renderKitId)
     
    javax.faces.application.StateManager.SerializedView
    saveSerializedView(javax.faces.context.FacesContext context)
     
    saveView(javax.faces.context.FacesContext context)
     
    void
    writeState(javax.faces.context.FacesContext context, Object state)
     
    void
    writeState(javax.faces.context.FacesContext context, javax.faces.application.StateManager.SerializedView state)
     

    Methods inherited from class javax.faces.application.StateManager

    getViewState

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CCStateManager

      public CCStateManager(javax.faces.application.StateManager parent)
  • Method Details

    • restoreView

      public javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext context, String viewId, String renderKitId)
      Specified by:
      restoreView in class javax.faces.application.StateManager
    • saveView

      public Object saveView(javax.faces.context.FacesContext context)
      Overrides:
      saveView in class javax.faces.application.StateManager
    • isSavingStateInClient

      public boolean isSavingStateInClient(javax.faces.context.FacesContext context)
      Overrides:
      isSavingStateInClient in class javax.faces.application.StateManager
    • writeState

      public void writeState(javax.faces.context.FacesContext context, Object state) throws IOException
      Overrides:
      writeState in class javax.faces.application.StateManager
      Throws:
      IOException
    • writeState

      public void writeState(javax.faces.context.FacesContext context, javax.faces.application.StateManager.SerializedView state) throws IOException
      Overrides:
      writeState in class javax.faces.application.StateManager
      Throws:
      IOException
    • saveSerializedView

      public javax.faces.application.StateManager.SerializedView saveSerializedView(javax.faces.context.FacesContext context)
      Overrides:
      saveSerializedView in class javax.faces.application.StateManager
    • getTreeStructureToSave

      protected Object getTreeStructureToSave(javax.faces.context.FacesContext context)
      Overrides:
      getTreeStructureToSave in class javax.faces.application.StateManager
    • getComponentStateToSave

      protected Object getComponentStateToSave(javax.faces.context.FacesContext context)
      Overrides:
      getComponentStateToSave in class javax.faces.application.StateManager
    • restoreTreeStructure

      protected javax.faces.component.UIViewRoot restoreTreeStructure(javax.faces.context.FacesContext context, String viewId, String renderKitId)
      Overrides:
      restoreTreeStructure in class javax.faces.application.StateManager
    • restoreComponentState

      protected void restoreComponentState(javax.faces.context.FacesContext context, javax.faces.component.UIViewRoot viewRoot, String renderKitId)
      Overrides:
      restoreComponentState in class javax.faces.application.StateManager