|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.util.ThreadContext
public class ThreadContext
This class is designed to hold thread specific information which can then be requested anywhere in the code.
| Field Summary | |
|---|---|
static short |
HTTP_SESSION
session types |
static short |
INTERNAL_SESSION
|
static short |
RMI_SESSION
|
static short |
WEBDAV_SESSION
|
static short |
WEBSERVICE_SESSION
|
| Constructor Summary | |
|---|---|
ThreadContext()
|
|
| Method Summary | ||
|---|---|---|
static void |
addThreadLocale(ThreadLocal<?> local)
|
|
static void |
clean()
Clean the thread context. |
|
static Object |
getAttribute(Object key)
Gets the value identified by the passed key |
|
Iterator<Object> |
getAttributeKeys()
Returns an iterator over all keys which were added via method setAttribute(Object, Object) |
|
static String |
getSessionId()
Get the thread sessionId. |
|
static ThreadLocal2<String> |
getSessions()
Get the sessions. |
|
static short |
getSessionType()
Get the type of the Session |
|
static Locale |
getThreadLocale()
Get the thread locale. |
|
static
|
getThreadPrincipal()
Get the thread princiapl, the user who performs the action. |
|
static HttpServletRequest |
getThreadRequest()
Get the HttpServletRequest of this thread. |
|
static TimeZone |
getThreadTimeZone()
Get the thread TimeZone |
|
static void |
internalClean()
Clean the thread context of internal sessions if configuration param is set to true |
|
static boolean |
isPrivileged()
Is the thread privileged. |
|
static void |
removeAttribute(Object key)
Removes the key-value pair identified by the passed key |
|
static void |
setAttribute(Object key,
Object value)
Adds a key-value pair to the thread's context. |
|
static void |
setPrivileged()
Set the thread privileged. |
|
static void |
setSessionId(String s)
Set the session id of the thread. |
|
static void |
setSessionType(short s)
Set the type of this thread. |
|
static void |
setThreadLocale(Locale l)
Set the locale of the thread. |
|
static void |
setThreadPrincipal(Principal p)
Set the principal of the thread. |
|
static void |
setThreadRequest(HttpServletRequest req)
Set the HttpServletRequest of the thread. |
|
static void |
setThreadTimeZone(TimeZone t)
Set the TimeZone of the thread. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final short HTTP_SESSION
public static final short RMI_SESSION
public static final short INTERNAL_SESSION
public static final short WEBDAV_SESSION
public static final short WEBSERVICE_SESSION
| Constructor Detail |
|---|
public ThreadContext()
| Method Detail |
|---|
public static void setThreadLocale(Locale l)
l - a locale objectpublic static Locale getThreadLocale()
public static void setThreadPrincipal(Principal p)
p - a Principal objectpublic static <T extends Principal> T getThreadPrincipal()
public static void setSessionId(String s)
s - a string objectpublic static String getSessionId()
public static void setThreadTimeZone(TimeZone t)
t - a TimeZone objectpublic static TimeZone getThreadTimeZone()
public static ThreadLocal2<String> getSessions()
public static void setPrivileged()
public static boolean isPrivileged()
public static void setThreadRequest(HttpServletRequest req)
req - a HttpServletRequest objectpublic static HttpServletRequest getThreadRequest()
public static short getSessionType()
public static void setSessionType(short s)
s - either HTTP_SESSION, RMI_SESSION or INTERNAL_SESSION
public static void setAttribute(Object key,
Object value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic static Object getAttribute(Object key)
key - key whose value should be retrieved
public static void removeAttribute(Object key)
key - key whose value should be removedpublic Iterator<Object> getAttributeKeys()
setAttribute(Object, Object)
public static void clean()
public static void internalClean()
public static void addThreadLocale(ThreadLocal<?> local)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||