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.28 2004/04/13 03:53:11 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)
           
 
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.


allThreadGroups

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


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.

toThreadDescription

public static java.lang.String toThreadDescription(java.lang.Thread thread)