|
|||||||||
| 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
|
| Constructor Summary | |
|---|---|
ThreadContext()
|
|
| Method Summary | |
|---|---|
static void |
clean()
Clean the thread context. |
static java.lang.Object |
getAttribute(java.lang.Object key)
Gets the value identified by the passed key |
java.util.Iterator |
getAttributeKeys()
Returns an iterator over all keys which were added via method setAttribute(Object, Object) |
static java.lang.String |
getSessionId()
Get the thread sessionId. |
static ThreadLocal2 |
getSessions()
Get the sessions. |
static short |
getSessionType()
Get the type of the Session |
static java.util.Locale |
getThreadLocale()
Get the thread locale. |
static java.security.Principal |
getThreadPrincipal()
Get the thread princiapl, the user who performs the action. |
static javax.servlet.http.HttpServletRequest |
getThreadRequest()
Get the HttpServletRequest of this thread. |
static java.util.TimeZone |
getThreadTimeZone()
Get the thread TimeZone |
static boolean |
isPrivileged()
Is the thread privileged. |
static void |
removeAttribute(java.lang.Object key)
Removes the key-value pair identified by the passed key |
static void |
setAttribute(java.lang.Object key,
java.lang.Object value)
Adds a key-value pair to the thread's context. |
static void |
setPrivileged()
Set the thread privileged. |
static void |
setSessionId(java.lang.String s)
Set the session id of the thread. |
static void |
setSessionType(short s)
Set the type of this thread. |
static void |
setThreadLocale(java.util.Locale l)
Set the locale of the thread. |
static void |
setThreadPrincipal(java.security.Principal p)
Set the principal of the thread. |
static void |
setThreadRequest(javax.servlet.http.HttpServletRequest req)
Set the HttpServletRequest of the thread. |
static void |
setThreadTimeZone(java.util.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
| Constructor Detail |
|---|
public ThreadContext()
| Method Detail |
|---|
public static void setThreadLocale(java.util.Locale l)
l - a locale objectpublic static java.util.Locale getThreadLocale()
public static void setThreadPrincipal(java.security.Principal p)
p - a Principal objectpublic static java.security.Principal getThreadPrincipal()
public static void setSessionId(java.lang.String s)
s - a string objectpublic static java.lang.String getSessionId()
public static void setThreadTimeZone(java.util.TimeZone t)
t - a TimeZone objectpublic static java.util.TimeZone getThreadTimeZone()
public static ThreadLocal2 getSessions()
public static void setPrivileged()
public static boolean isPrivileged()
public static void setThreadRequest(javax.servlet.http.HttpServletRequest req)
req - a HttpServletRequest objectpublic static javax.servlet.http.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(java.lang.Object key,
java.lang.Object value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic static java.lang.Object getAttribute(java.lang.Object key)
key - key whose value should be retrieved
public static void removeAttribute(java.lang.Object key)
key - key whose value should be removedpublic java.util.Iterator getAttributeKeys()
setAttribute(Object, Object)
public static void clean()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||