org.apache.myfaces.application.jsp
Class JspStateManagerImpl

java.lang.Object
  extended by javax.faces.application.StateManager
      extended by org.apache.myfaces.application.MyfacesStateManager
          extended by org.apache.myfaces.application.jsp.JspStateManagerImpl

public class JspStateManagerImpl
extends MyfacesStateManager

Default StateManager implementation for use when views are defined via tags in JSP pages.

Version:
$Revision: 1187700 $ $Date: 2011-10-22 07:19:37 -0500 (Sat, 22 Oct 2011) $
Author:
Thomas Spiegl (latest modification by $Author: bommel $), Manfred Geiler

Nested Class Summary
protected static class JspStateManagerImpl.SerializedViewCollection
           
protected static class JspStateManagerImpl.SerializedViewKey
           
 
Nested classes/interfaces inherited from class javax.faces.application.StateManager
StateManager.SerializedView
 
Field Summary
 
Fields inherited from class javax.faces.application.StateManager
FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME, PARTIAL_STATE_SAVING_PARAM_NAME, STATE_SAVING_METHOD_CLIENT, STATE_SAVING_METHOD_PARAM_NAME, STATE_SAVING_METHOD_SERVER
 
Constructor Summary
JspStateManagerImpl()
           
 
Method Summary
protected  Object deserializeView(Object state)
           
protected  Object getComponentStateToSave(FacesContext facesContext)
           
protected  int getNextViewSequence(FacesContext context)
           
protected  RenderKitFactory getRenderKitFactory()
           
protected  Object getSerializedViewFromServletSession(FacesContext context, String viewId, Integer sequence)
           
protected  Integer getServerStateId(Object[] state)
           
protected  Object getTreeStructureToSave(FacesContext facesContext)
          Return an object which contains info about the UIComponent type of each node in the view tree.
 String getViewState(FacesContext facesContext)
           
protected  boolean isCompressStateInSession(FacesContext context)
          Reads the value of the org.apache.myfaces.COMPRESS_STATE_IN_SESSION context parameter.
protected  boolean isSerializeStateInSession(FacesContext context)
          Reads the value of the org.apache.myfaces.SERIALIZE_STATE_IN_SESSION context parameter.
protected  void nextViewSequence(FacesContext facescontext)
           
protected  void restoreComponentState(FacesContext facesContext, UIViewRoot uiViewRoot, String renderKitId)
          Given a tree of UIComponent objects created the default constructor for each node, retrieve saved state info (from either the client or the server) and walk the tree restoring the members of each node from the saved state information.
protected  UIViewRoot restoreTreeStructure(FacesContext facesContext, String viewId, String renderKitId)
          See getTreeStructureToSave.
 UIViewRoot restoreView(FacesContext facesContext, String viewId, String renderKitId)
           
 StateManager.SerializedView saveSerializedView(FacesContext facesContext)
           
protected  void saveSerializedViewInServletSession(FacesContext context, Object serializedView)
           
 Object saveView(FacesContext facesContext)
          Wrap the original method and redirect to VDL StateManagementStrategy when necessary
protected  Object serializeView(FacesContext context, Object serializedView)
           
 void writeState(FacesContext facesContext, StateManager.SerializedView serializedView)
           
 void writeStateAsUrlParams(FacesContext facesContext, StateManager.SerializedView serializedView)
          MyFaces extension
 
Methods inherited from class javax.faces.application.StateManager
isSavingStateInClient, writeState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JspStateManagerImpl

public JspStateManagerImpl()
Method Detail

getComponentStateToSave

protected Object getComponentStateToSave(FacesContext facesContext)
Overrides:
getComponentStateToSave in class StateManager

getTreeStructureToSave

protected Object getTreeStructureToSave(FacesContext facesContext)
Return an object which contains info about the UIComponent type of each node in the view tree. This allows an identical UIComponent tree to be recreated later, though all the components will have just default values for their members.

Overrides:
getTreeStructureToSave in class StateManager

restoreComponentState

protected void restoreComponentState(FacesContext facesContext,
                                     UIViewRoot uiViewRoot,
                                     String renderKitId)
Given a tree of UIComponent objects created the default constructor for each node, retrieve saved state info (from either the client or the server) and walk the tree restoring the members of each node from the saved state information.

Overrides:
restoreComponentState in class StateManager

getServerStateId

protected Integer getServerStateId(Object[] state)

restoreTreeStructure

protected UIViewRoot restoreTreeStructure(FacesContext facesContext,
                                          String viewId,
                                          String renderKitId)
See getTreeStructureToSave.

Overrides:
restoreTreeStructure in class StateManager

restoreView

public UIViewRoot restoreView(FacesContext facesContext,
                              String viewId,
                              String renderKitId)
Specified by:
restoreView in class StateManager

saveView

public Object saveView(FacesContext facesContext)
Wrap the original method and redirect to VDL StateManagementStrategy when necessary

Overrides:
saveView in class StateManager

saveSerializedView

public StateManager.SerializedView saveSerializedView(FacesContext facesContext)
                                               throws IllegalStateException
Overrides:
saveSerializedView in class StateManager
Throws:
IllegalStateException

writeState

public void writeState(FacesContext facesContext,
                       StateManager.SerializedView serializedView)
                throws IOException
Overrides:
writeState in class StateManager
Throws:
IOException

getViewState

public String getViewState(FacesContext facesContext)
Overrides:
getViewState in class StateManager

writeStateAsUrlParams

public void writeStateAsUrlParams(FacesContext facesContext,
                                  StateManager.SerializedView serializedView)
                           throws IOException
MyFaces extension

Specified by:
writeStateAsUrlParams in class MyfacesStateManager
Parameters:
facesContext -
serializedView -
Throws:
IOException

getRenderKitFactory

protected RenderKitFactory getRenderKitFactory()

saveSerializedViewInServletSession

protected void saveSerializedViewInServletSession(FacesContext context,
                                                  Object serializedView)

getSerializedViewFromServletSession

protected Object getSerializedViewFromServletSession(FacesContext context,
                                                     String viewId,
                                                     Integer sequence)

getNextViewSequence

protected int getNextViewSequence(FacesContext context)

nextViewSequence

protected void nextViewSequence(FacesContext facescontext)

serializeView

protected Object serializeView(FacesContext context,
                               Object serializedView)

isSerializeStateInSession

protected boolean isSerializeStateInSession(FacesContext context)
Reads the value of the org.apache.myfaces.SERIALIZE_STATE_IN_SESSION context parameter.

Parameters:
context - FacesContext for the request we are processing.
Returns:
boolean true, if the server state should be serialized in the session
See Also:
SERIALIZE_STATE_IN_SESSION_PARAM

isCompressStateInSession

protected boolean isCompressStateInSession(FacesContext context)
Reads the value of the org.apache.myfaces.COMPRESS_STATE_IN_SESSION context parameter.

Parameters:
context - FacesContext for the request we are processing.
Returns:
boolean true, if the server state steam should be compressed
See Also:
COMPRESS_SERVER_STATE_PARAM

deserializeView

protected Object deserializeView(Object state)


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.