|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.myfaces.trinidadinternal.util.TokenCacheDebugUtils
public final class TokenCacheDebugUtils
ViewExpiredExceptions are fairly common, and the token cache is used for page state tokens, but the tokens aren't really human readable. In order to make it easier to understand what is in the cache we've added a system property for debugging purposes. When enabled we store a map of token -> viewId on the session which we use to log something more human readable. in order to use this the tester would set the system property to: -Dorg.apache.myfaces.trinidadinternal.DEBUG_TOKEN_CACHE=true TokenCacheDebugUtils provides methods to log human readable debugging info. The goal is to provide as much logging information in a single log message as possible. In order to do this we are pushing log info into a buffer and when we're ready to log we can get the string. To start the log call like so: TokenCacheDebugUtils.startLog("My Custom String"); Then you can call methods like: TokenCacheDebugUtils.logCacheInfo(stateMap, null, "hello world"); TokenCacheDebugUtils.addToLog("foo bar"); Then when you're ready to actually put it in the log you would do this: _LOG.severe(TokenCacheDebugUtils.getLogString());
| Method Summary | ||
|---|---|---|
static void |
addTokenToViewIdMap(java.lang.String token)
In order to provide human readable information there is a map which has token to viewId information. |
|
static void |
addToLog(java.lang.String addString)
Add a string to the current log buffer This method should only be called when debugTokenCache() is true |
|
static boolean |
debugTokenCache()
Checks whether we are debugging the token cache. |
|
static java.lang.String |
getLogString()
get the string from the log buffer. |
|
static java.lang.String |
getTokenToViewIdString(java.lang.String token)
Generate a string showing the token and the view id we have saved for that token This method should only be called when debugTokenCache() is true |
|
static
|
logCacheInfo(java.util.Map<java.lang.String,V> targetStore,
java.util.Map<java.lang.String,java.lang.String> pinned,
java.lang.String logAddition)
Add info about the cache to the log buffer. |
|
static void |
removeTokenFromViewIdMap(java.lang.String token)
In order to provide human readable information there is a map which has token to viewId information. |
|
static void |
startLog(java.lang.String startString)
Start a log buffer. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean debugTokenCache()
public static void addTokenToViewIdMap(java.lang.String token)
public static void removeTokenFromViewIdMap(java.lang.String token)
public static java.lang.String getTokenToViewIdString(java.lang.String token)
public static <V> void logCacheInfo(java.util.Map<java.lang.String,V> targetStore,
java.util.Map<java.lang.String,java.lang.String> pinned,
java.lang.String logAddition)
public static void addToLog(java.lang.String addString)
public static void startLog(java.lang.String startString)
public static java.lang.String getLogString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||