|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutil.testsuite.PrintThreads
public class PrintThreads
PrintThreads prints all the Threads in the current JVM. This class will work in both applications and applets. When run in an applet, this class attempts to gracefully handle the various security restrictions concerning getting the parent of a ThreadGroup. The output includes the number of threads and whether the current thread is the Swing Event Dispatch Thread.
To get a stack trace for each thread:
Under Unix, try kill -3 pid
, where
pid
is the process id from ps
.
Under Windows, try Ctrl-Break
.
Red (cxh) |
Red (cxh) |
Constructor Summary | |
---|---|
PrintThreads()
|
Method Summary | |
---|---|
private static java.lang.String |
_getHeader()
|
private static java.lang.String |
_stringFormat(java.lang.String inputString,
int length)
|
static java.lang.String |
allThreadGroups()
Return a String containing all the ThreadGroups in the JVM that are descendents of the root ThreadGroup. |
static java.lang.String |
allThreads(boolean indicateEventDispatchThread)
Return a string containing all the threads in the JVM who are members of ThreadGroups which are descendants of the root ThreadGroup. |
static java.lang.ThreadGroup |
rootThreadGroup()
Get the root ThreadGroup of the Java Virtual Machine. |
static java.lang.String |
toThreadDescription(java.lang.Thread thread)
Return a user friendly description of the thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrintThreads()
Method Detail |
---|
public static java.lang.ThreadGroup rootThreadGroup()
public static java.lang.String allThreadGroups()
public static java.lang.String allThreads(boolean indicateEventDispatchThread)
indicateEventDispatchThread
- true if we should indicate
which thread is the Swing Event Dispatch Thread.
public static java.lang.String toThreadDescription(java.lang.Thread thread)
thread
- The thread
private static final java.lang.String _getHeader()
private static final java.lang.String _stringFormat(java.lang.String inputString, int length)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |