Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

util.testsuite
Class PrintThreads

java.lang.Object
 extended byutil.testsuite.PrintThreads

public class PrintThreads
extends java.lang.Object

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.

Since:
Ptolemy II 1.0
Version:
$Id: PrintThreads.java,v 1.44 2006年08月21日 23:17:05 cxh Exp $
Author:
Christopher Hylands, based on code from Fusion Systems Group
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Constructor Summary
PrintThreads()
Method Summary
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

PrintThreads

public PrintThreads()
Method Detail

rootThreadGroup

public static java.lang.ThreadGroup rootThreadGroup()
Get the root ThreadGroup of the Java Virtual Machine. This method assumes that the current Thread is a member of a ThreadGroup which is a descendant of the root ThreadGroup.

Returns:
The root thread group.

allThreadGroups

public static java.lang.String allThreadGroups()
Return a String containing all the ThreadGroups in the JVM that are descendents of the root ThreadGroup.

Returns:
A string naming all the ThreadGroups.

allThreads

public 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.

Parameters:
indicateEventDispatchThread - true if we should indicate which thread is the Swing Event Dispatch Thread.
Returns:
A string naming all the threads.

toThreadDescription

public static java.lang.String toThreadDescription(java.lang.Thread thread)
Return a user friendly description of the thread. We could use Thread.toString(), but that is hard to read.

Parameters:
thread - The thread
Returns:
A user friendly description of the thread.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

AltStyle によって変換されたページ (->オリジナル) /