ThreadGroup

public class ThreadGroup extends Object
implements Thread.UncaughtExceptionHandler

A thread group represents a set of threads. In addition, a thread group can also include other thread groups. The thread groups form a tree in which every thread group except the initial thread group has a parent.

A thread is allowed to access information about its own thread group, but not to access information about its thread group's parent thread group or any other thread groups.

Public Constructor Summary

ThreadGroup(String name)
Constructs a new thread group.
ThreadGroup(ThreadGroup parent, String name)
Creates a new thread group.

Public Method Summary

int
activeCount()
Returns an estimate of the number of active threads in this thread group and its subgroups.
int
activeGroupCount()
Returns an estimate of the number of active groups in this thread group and its subgroups.
final void
checkAccess()
Determines if the currently running thread has permission to modify this thread group.
final void
destroy()
Destroys this thread group and all of its subgroups.
int
enumerate(ThreadGroup[] list)
Copies into the specified array references to every active subgroup in this thread group and its subgroups.
int
enumerate(ThreadGroup[] list, boolean recurse)
Copies into the specified array references to every active subgroup in this thread group.
int
enumerate(Thread[] list)
Copies into the specified array every active thread in this thread group and its subgroups.
int
enumerate(Thread[] list, boolean recurse)
Copies into the specified array every active thread in this thread group.
final int
getMaxPriority()
Returns the maximum priority of this thread group.
final String
getName()
Returns the name of this thread group.
final ThreadGroup
getParent()
Returns the parent of this thread group.
final void
interrupt()
Interrupts all threads in this thread group.
final boolean
isDaemon()
Tests if this thread group is a daemon thread group.
synchronized boolean
isDestroyed()
Tests if this thread group has been destroyed.
void
list()
Prints information about this thread group to the standard output.
final boolean
parentOf(ThreadGroup g)
Tests if this thread group is either the thread group argument or one of its ancestor thread groups.
final void
resume()
This method was deprecated. This method is used solely in conjunction with Thread.suspend and ThreadGroup.suspend, both of which have been deprecated, as they are inherently deadlock-prone. See suspend() for details.
final void
setDaemon(boolean daemon)
Changes the daemon status of this thread group.
final void
setMaxPriority(int pri)
Sets the maximum priority of the group.
final void
stop()
This method was deprecated. This method is inherently unsafe. See stop() for details.
final void
suspend()
This method was deprecated. This method is inherently deadlock-prone. See suspend() for details.
String
toString()
Returns a string representation of this Thread group.
void
uncaughtException(Thread t, Throwable e)
Called by the Java Virtual Machine when a thread in this thread group stops because of an uncaught exception, and the thread does not have a specific Thread.UncaughtExceptionHandler installed.

Inherited Method Summary

Public Constructors

public ThreadGroup (String name)

<