|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidad.bean.util.StateUtils
public final class StateUtils
Utilities for handling state persistance.
Constructor Summary | |
---|---|
StateUtils()
|
Method Summary | |
---|---|
static boolean |
checkApplicationSerialization(javax.faces.context.ExternalContext extContext)
Returns true if Object written to the ExternalContext's Application Map should be
checked for Serializability when put is called. |
static boolean |
checkComponentStateSerialization(javax.faces.context.FacesContext context)
Returns true if components should be checked for
serializability when when generating the view's state object. |
static boolean |
checkComponentTreeStateSerialization(javax.faces.context.FacesContext context)
Returns true if the component tree should be checked for
serializability when when generating the view's state object. |
static boolean |
checkSessionSerialization(javax.faces.context.ExternalContext extContext)
Returns true if Object written to the ExternalContext's Session Map should be
checked for Serializability when put is called. |
static PropertyKey |
restoreKey(FacesBean.Type type,
java.lang.Object value)
Restores a persisted PropertyKey. |
static java.lang.Object |
restoreList(javax.faces.context.FacesContext context,
java.lang.Object savedValue)
Restores a List whose elements may implement StateHolder. |
static void |
restoreState(PropertyMap map,
javax.faces.context.FacesContext context,
FacesBean.Type type,
java.lang.Object state,
boolean useStateHolder)
Generic (unoptimized) version of PropertyMap state restoring. |
static java.lang.Object |
restoreStateHolder(javax.faces.context.FacesContext context,
java.lang.Object savedValue)
Restores an object that was saved using saveStateHolder() |
static java.lang.Object |
saveKey(PropertyKey key)
Persists a property key. |
static java.lang.Object |
saveList(javax.faces.context.FacesContext context,
java.lang.Object value)
Saves a List whose elements may implement StateHolder. |
static java.lang.Object |
saveState(PropertyMap map,
javax.faces.context.FacesContext context,
boolean useStateHolder)
Generic (unoptimized) version of PropertyMap state saving. |
static java.lang.Object |
saveStateHolder(javax.faces.context.FacesContext context,
java.lang.Object value)
Saves an object that may implement StateHolder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateUtils()
Method Detail |
---|
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
.
checkComponentTreeStateSerialization(javax.faces.context.FacesContext)
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.
checkComponentStateSerialization(javax.faces.context.FacesContext)
,
checkComponentTreeStateSerialization(javax.faces.context.FacesContext)
,
checkApplicationSerialization(javax.faces.context.ExternalContext)
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.
checkComponentStateSerialization(javax.faces.context.FacesContext)
,
checkComponentTreeStateSerialization(javax.faces.context.FacesContext)
,
checkSessionSerialization(javax.faces.context.ExternalContext)
public static java.lang.Object saveKey(PropertyKey key)
public static PropertyKey restoreKey(FacesBean.Type type, java.lang.Object value)
public static java.lang.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, java.lang.Object state, boolean useStateHolder)
public static java.lang.Object saveStateHolder(javax.faces.context.FacesContext context, java.lang.Object value)
public static java.lang.Object restoreStateHolder(javax.faces.context.FacesContext context, java.lang.Object savedValue)
public static java.lang.Object saveList(javax.faces.context.FacesContext context, java.lang.Object value)
public static java.lang.Object restoreList(javax.faces.context.FacesContext context, java.lang.Object savedValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |