Package org.eclnt.jsfserver.util
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).
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
-
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 classjavax.faces.application.StateManager
-
saveView
- Overrides:
saveView
in classjavax.faces.application.StateManager
-
isSavingStateInClient
public boolean isSavingStateInClient(javax.faces.context.FacesContext context) - Overrides:
isSavingStateInClient
in classjavax.faces.application.StateManager
-
writeState
- Overrides:
writeState
in classjavax.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 classjavax.faces.application.StateManager
- Throws:
IOException
-
saveSerializedView
public javax.faces.application.StateManager.SerializedView saveSerializedView(javax.faces.context.FacesContext context) - Overrides:
saveSerializedView
in classjavax.faces.application.StateManager
-
getTreeStructureToSave
- Overrides:
getTreeStructureToSave
in classjavax.faces.application.StateManager
-
getComponentStateToSave
- Overrides:
getComponentStateToSave
in classjavax.faces.application.StateManager
-
restoreTreeStructure
protected javax.faces.component.UIViewRoot restoreTreeStructure(javax.faces.context.FacesContext context, String viewId, String renderKitId) - Overrides:
restoreTreeStructure
in classjavax.faces.application.StateManager
-
restoreComponentState
protected void restoreComponentState(javax.faces.context.FacesContext context, javax.faces.component.UIViewRoot viewRoot, String renderKitId) - Overrides:
restoreComponentState
in classjavax.faces.application.StateManager
-