|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.apache.tomcat.util.threads.ThreadWithAttributes
public class ThreadWithAttributes
Special thread that allows storing of attributes and notes. A guard is used to prevent untrusted code from accessing the attributes. This avoids hash lookups and provide something very similar with ThreadLocal ( but compatible with JDK1.1 and faster on JDK < 1.4 ). The main use is to store 'state' for monitoring ( like "processing request 'GET /' ").
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static int |
MAX_NOTES
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ThreadWithAttributes(java.lang.Object control,
java.lang.Runnable r)
|
Method Summary | |
---|---|
java.util.Hashtable |
getAttributes(java.lang.Object control)
Generic attributes. |
java.lang.String |
getCurrentStage(java.lang.Object control)
Information about the curent performed operation |
java.lang.Object |
getNote(java.lang.Object control,
int id)
|
java.lang.Object |
getParam(java.lang.Object control)
Information about the current request ( or the main object we are processing ) |
java.lang.Object[] |
getThreadData(java.lang.Object control)
|
void |
setCurrentStage(java.lang.Object control,
java.lang.String currentStage)
|
void |
setNote(java.lang.Object control,
int id,
java.lang.Object value)
Notes - for attributes that need fast access ( array ) The application is responsible for id management |
void |
setParam(java.lang.Object control,
java.lang.Object param)
|
void |
setThreadData(java.lang.Object control,
java.lang.Object[] thData)
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int MAX_NOTES
Constructor Detail |
---|
public ThreadWithAttributes(java.lang.Object control, java.lang.Runnable r)
Method Detail |
---|
public final java.lang.Object[] getThreadData(java.lang.Object control)
public final void setThreadData(java.lang.Object control, java.lang.Object[] thData)
public final void setNote(java.lang.Object control, int id, java.lang.Object value)
public final java.lang.String getCurrentStage(java.lang.Object control)
public final java.lang.Object getParam(java.lang.Object control)
public final void setCurrentStage(java.lang.Object control, java.lang.String currentStage)
public final void setParam(java.lang.Object control, java.lang.Object param)
public final java.lang.Object getNote(java.lang.Object control, int id)
public final java.util.Hashtable getAttributes(java.lang.Object control)
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |