All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----java.lang.ThreadGroup
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 ThreadGroup(String name)
public ThreadGroup(ThreadGroup parent,
String name)
The checkAccess
method of the parent thread group is
called with no arguments; this may result in a security exception.
null
.
public final String getName()
public final ThreadGroup getParent()
null
.
public final int getMaxPriority()
public final boolean isDaemon()
true
if this thread group is a daemon thread group;
false
otherwise.
public synchronized boolean isDestroyed()
public final void setDaemon(boolean daemon)
First, the checkAccess
method of this thread group is
called with no arguments; this may result in a security exception.
A daemon thread group is automatically destroyed when its last thread is stopped or its last thread group is destroyed.
true
, marks this thread group as
a daemon thread group; otherwise, marks this
thread group as normal.
public final void setMaxPriority(int pri)
First, the checkAccess
method of this thread group is
called with no arguments; this may result in a security exception.
Threads in the thread group that already have a higher priority are not affected.
public final boolean parentOf(ThreadGroup g)
true
if this thread group is the thread group
argument or one of its ancestor thread groups;
false
otherwise.
public final void checkAccess()
If there is a security manager, its checkAccess
method
is called with this thread group as its argument. This may result
in throwing a SecurityException
.
public int activeCount()
public int enumerate(Thread list[])
An application should use the activeCount
method to
get an estimate of how big the array should be. If the array is
too short to hold all the threads, the extra threads are silently
ignored.
public int enumerate(Thread list[],
boolean recurse)
recurse
flag is
true
, references to every active thread in this
thread's subgroups are also included. If the array is too short to
hold all the threads, the extra threads are silently ignored.
An application should use the activeCount
method to
get an estimate of how big the array should be.
public int activeGroupCount()
public int enumerate(ThreadGroup list[])
An application should use the activeGroupCount
method to get an estimate of how big the array should be. If the
array is too short to hold all the thread groups, the extra thread
groups are silently ignored.
public int enumerate(ThreadGroup list[],
boolean recurse)
recurse
flag is
true
, references to all active subgroups of the
subgroups and so forth are also included.
An application should use the activeGroupCount
method to get an estimate of how big the array should be.
public final void stop()
First, the checkAccess
method of this thread group is
called with no arguments; this may result in a security exception.
This method then calls the stop
method on all the
threads in this thread group and in all of its subgroups.
public final void suspend()
First, the checkAccess
method of this thread group is
called with no arguments; this may result in a security exception.
This method then calls the suspend
method on all the
threads in this thread group and in all of its subgroups.
public final void resume()
First, the checkAccess
method of this thread group is
called with no arguments; this may result in a security exception.
This method then calls the resume
method on all the
threads in this thread group and in all of its sub groups.
public final void destroy()
public void list()
public void uncaughtException(Thread t,
Throwable e)
The uncaughtException
method of
ThreadGroup
does the following:
uncaughtException
method of that parent is called
with the same two arguments.
Throwable
argument is an instance of ThreadDeath
. If so, nothing
special is done. Otherwise, the Throwable
's
printStackTrace
method is called to print a stack
backtrace to the standard error stream.
Applications can override this method in subclasses of
ThreadGroup
to provide alternative handling of
uncaught exceptions.
public boolean allowThreadSuspension(boolean b)
public String toString()
All Packages Class Hierarchy This Package Previous Next Index