Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » tomcat » util » threads » [javadoc | source]
org.apache.tomcat.util.threads
public class: ThreadWithAttributes [javadoc | source]
java.lang.Object
   java.lang.Thread
      org.apache.tomcat.util.threads.ThreadWithAttributes

All Implemented Interfaces:
    Runnable

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 /' ").
Field Summary
public static  int MAX_NOTES     
Fields inherited from java.lang.Thread:
MIN_PRIORITY,  NORM_PRIORITY,  MAX_PRIORITY
Constructor:
 public ThreadWithAttributes(Object control,
    Runnable r) 
Method from org.apache.tomcat.util.threads.ThreadWithAttributes Summary:
getAttributes,   getCurrentStage,   getNote,   getParam,   getThreadData,   setCurrentStage,   setNote,   setParam,   setThreadData
Methods from 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 from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.threads.ThreadWithAttributes Detail:
 public final Hashtable getAttributes(Object control) 
    Generic attributes. You'll need a hashtable lookup - you can use notes for array access.
 public final String getCurrentStage(Object control) 
    Information about the curent performed operation
 public final Object getNote(Object control,
    int id) 
 public final Object getParam(Object control) 
    Information about the current request ( or the main object we are processing )
 public final Object[] getThreadData(Object control) 
 public final  void setCurrentStage(Object control,
    String currentStage) 
 public final  void setNote(Object control,
    int id,
    Object value) 
    Notes - for attributes that need fast access ( array ) The application is responsible for id management
 public final  void setParam(Object control,
    Object param) 
 public final  void setThreadData(Object control,
    Object[] thData)