public final class GlobalVariables extends Object
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clears out GlobalVariable objects with the exception of the UserSession
|
static <T> T |
doInNewGlobalVariables(Callable<T> callable)
Pushes a new GlobalVariables object onto the ThreadLocal GlobalVariables stack, invokes the runnable,
and pops the GlobalVariables off in a finally clause
|
static <T> T |
doInNewGlobalVariables(UserSession userSession,
Callable<T> callable)
Convenience method that creates a new GlobalVariables stack frame, initialized with the provided
UserSession (which may be the previous UserSession).
|
static Map<String,AuditCluster> |
getAuditErrorMap() |
static GlobalVariables |
getCurrentGlobalVariables() |
static MessageMap |
getMessageMap() |
static Object |
getRequestCache(String cacheName) |
static UifFormManager |
getUifFormManager()
Retrieves the
UifFormManager which can be used to store and remove forms
from the session |
static UserSession |
getUserSession() |
static void |
injectGlobalVariables(GlobalVariables globalVariables) |
static void |
mergeErrorMap(MessageMap messageMap)
Merges a message map into the global variables error map
|
static GlobalVariables |
popGlobalVariables() |
static void |
setAuditErrorMap(HashMap<String,AuditCluster> errorMap)
Sets a new (clean) AuditErrorList
|
static void |
setHideSessionFromTestsMessage(String message)
Sets an error message for tests that try to use the session without declaring it.
|
static void |
setMessageMap(MessageMap messageMap)
Sets a new (clean) MessageMap
|
static void |
setRequestCache(String cacheName,
Object cacheObject) |
static void |
setUifFormManager(UifFormManager uifFormManager)
Sets a
UifFormManager for the current thread |
static void |
setUserSession(UserSession userSession)
sets the userSession object into the global variable for this thread
|
public static GlobalVariables getCurrentGlobalVariables()
public static void injectGlobalVariables(GlobalVariables globalVariables)
public static GlobalVariables popGlobalVariables()
public static UserSession getUserSession()
public static void setHideSessionFromTestsMessage(String message)
message
- the detail to throw, or null to allow access to the sessionpublic static void setUserSession(UserSession userSession)
userSession
- public static MessageMap getMessageMap()
public static void mergeErrorMap(MessageMap messageMap)
messageMap
- public static void setMessageMap(MessageMap messageMap)
messageMap
- public static Object getRequestCache(String cacheName)
public static void setRequestCache(String cacheName, Object cacheObject)
public static UifFormManager getUifFormManager()
UifFormManager
which can be used to store and remove forms
from the sessionpublic static void setUifFormManager(UifFormManager uifFormManager)
UifFormManager
for the current threaduifFormManager
- public static Map<String,AuditCluster> getAuditErrorMap()
public static void setAuditErrorMap(HashMap<String,AuditCluster> errorMap)
errorMap
- public static void clear()
public static <T> T doInNewGlobalVariables(Callable<T> callable) throws Exception
T
- callable return typecallable
- the code to run under a new set of GlobalVariablesException
- from Callable.call()
public static <T> T doInNewGlobalVariables(UserSession userSession, Callable<T> callable) throws Exception
T
- callable return typeuserSession
- the UserSession to initialize the new frame with (may be null)callable
- the code to run under a new set of GlobalVariablesException
- from Callable.call()
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.