public final class StateUtils extends Object
| Constructor and Description | 
|---|
| StateUtils() | 
| Modifier and Type | Method and Description | 
|---|---|
| static boolean | checkApplicationSerialization(javax.faces.context.ExternalContext extContext)Returns  trueif Object written to the ExternalContext's Application Map should be
 checked for Serializability whenputis called. | 
| static boolean | checkComponentStateSerialization(javax.faces.context.FacesContext context)Returns  trueif components should be checked for
 serializability when when generating the view's state object. | 
| static boolean | checkComponentTreeStateSerialization(javax.faces.context.FacesContext context)Returns  trueif the component tree should be checked for
 serializability when when generating the view's state object. | 
| static boolean | checkManagedBeanMutation(javax.faces.context.ExternalContext extContext)Returns  trueif the attributes of the session and application Maps should be
 checked for cases where the attribute was mutated but not dirtied for failover. | 
| static boolean | checkScopesAtEndOfRequest(javax.faces.context.ExternalContext extContext)Returns  trueif all attributes in the session Map should be
 checked for serializability at the end of each request. | 
| static boolean | checkSessionSerialization(javax.faces.context.ExternalContext extContext)Returns  trueif Object written to the ExternalContext's Session Map should be
 checked for Serializability whenputis called. | 
| static PropertyKey | restoreKey(FacesBean.Type type,
          Object value)Restores a persisted PropertyKey. | 
| static Object | restoreList(javax.faces.context.FacesContext context,
           Object savedValue)Restores a List whose elements may implement StateHolder. | 
| static void | restoreState(PropertyMap map,
            javax.faces.context.FacesContext context,
            FacesBean.Type type,
            Object state,
            boolean useStateHolder)Generic (unoptimized) version of PropertyMap state restoring. | 
| static Object | restoreStateHolder(javax.faces.context.FacesContext context,
                  Object savedValue)Restores an object that was saved using saveStateHolder() | 
| static Object | saveKey(PropertyKey key)Persists a property key. | 
| static Object | saveList(javax.faces.context.FacesContext context,
        Object value)Saves a List whose elements may implement StateHolder. | 
| static Object | saveState(PropertyMap map,
         javax.faces.context.FacesContext context,
         boolean useStateHolder)Generic (unoptimized) version of PropertyMap state saving. | 
| static Object | saveStateHolder(javax.faces.context.FacesContext context,
               Object value)Saves an object that may implement StateHolder. | 
public static boolean checkComponentStateSerialization(javax.faces.context.FacesContext context)
true if components should be checked for
 serializability when when generating the view's state object.
 
 By default component state serialization checking is off.  It can be
 enabled by setting the system property
 org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION
 to all or, more rarely, adding component to the
 comma-separated list of serialization checks to perform.
 
 As property serialization checking is expensive, it is usually
 only enabled after component tree serialization checking has detected
 a problem.  In addition, since component serialization checking only
 detects the problem component, it is usually combined with
 property state serialization checking either by specifying all.
public static boolean checkComponentTreeStateSerialization(javax.faces.context.FacesContext context)
true if the component tree should be checked for
 serializability when when generating the view's state object.
 
 By default component tree state serialization checking is off.  It can be
 enabled by setting the system property
 org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION
 to all or, more commonly, adding tree to the
 comma-separated list of serialization checks to perform.
 
 Because unserializable objects defeat fail-over, it is important to
 check for serializability when testing applications.  While component
 tree state serializability checking isn't cheap, it is much faster to
 initially only enable checking of the component tree and then switch
 to all testing to determine the problem component and
 property when the component tree testing determines a problem.
checkComponentStateSerialization(javax.faces.context.FacesContext)public static boolean checkSessionSerialization(javax.faces.context.ExternalContext extContext)
true if Object written to the ExternalContext's Session Map should be
 checked for Serializability when put is called.
 Configuring this property allows this aspect of high-availability to be tested without configuring the server to run in high-availability mode.
 By default session serialization checking is off.  It can be
 enabled by setting the system property
 org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION
 to all or, more commonly, adding session to the
 comma-separated list of serialization checks to perform.
public static boolean checkApplicationSerialization(javax.faces.context.ExternalContext extContext)
true if Object written to the ExternalContext's Application Map should be
 checked for Serializability when put is called.
 Configuring this property allows this aspect of high-availability to be tested without configuring the server to run in high-availability mode.
 By default application serialization checking is off.  It can be
 enabled by setting the system property
 org.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION
 to all or, more commonly, adding application to the
 comma-separated list of serialization checks to perform.
public static boolean checkManagedBeanMutation(javax.faces.context.ExternalContext extContext)
true if the attributes of the session and application Maps should be
 checked for cases where the attribute was mutated but not dirtied for failover.  If
 checkSessionSerialization returns true, the contents of the
 Session should be checked.  If checkApplicationSerialization returns
 true, the Serializable content of the Application should be checked.checkApplicationSerialization(javax.faces.context.ExternalContext), 
checkSessionSerialization(javax.faces.context.ExternalContext)public static boolean checkScopesAtEndOfRequest(javax.faces.context.ExternalContext extContext)
true if all attributes in the session Map should be
 checked for serializability at the end of each request.  This check should
 only be performed if checkSessionSerialization also returns true.public static Object saveKey(PropertyKey key)
public static PropertyKey restoreKey(FacesBean.Type type, Object value)
public static Object saveState(PropertyMap map, javax.faces.context.FacesContext context, boolean useStateHolder)
public static void restoreState(PropertyMap map, javax.faces.context.FacesContext context, FacesBean.Type type, Object state, boolean useStateHolder)
public static Object saveStateHolder(javax.faces.context.FacesContext context, Object value)
public static Object restoreStateHolder(javax.faces.context.FacesContext context, Object savedValue)
public static Object saveList(javax.faces.context.FacesContext context, Object value)
Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.