public class ThreadGroup extends Object
Constructor and Description |
---|
ThreadGroup(String name)
Constructor ThreadGroup(String)
- parent is the ThreadGroup of which the current (calling) Thread
is a member.
|
ThreadGroup(ThreadGroup parent,
String name)
Constructor ThreadGroup(ThreadGroup parent, String name)
constructs a ThreadGroup with the given name and parent.
|
Modifier and Type | Method and Description |
---|---|
int |
activeCount()
activeCount()
estimates the number of active threads in this ThreadGroup.
|
int |
activeGroupCount()
activeGroupCount()
estimates the number of thread groups in this ThreadGroup.
|
boolean |
allowThreadSuspension(boolean b) |
void |
checkAccess()
checkAccess()
checks that the current (calling) thread is allowed to modify this
ThreadGroup.
|
void |
destroy()
destroy()
deregisters this ThreadGroup and all its direct and indirect children
from their respective parents (thereby rendering them eligible for
garbage collection).
|
int |
enumerate(Thread[] threads)
enumerate(Thread[] threads) --> enumerate(Thread[] threads, false).
|
int |
enumerate(Thread[] threads,
boolean recurse) |
int |
enumerate(ThreadGroup[] list) |
int |
enumerate(ThreadGroup[] list,
boolean recursive) |
int |
getMaxPriority() |
String |
getName()
getName()
returns the name of this ThreadGroup.
|
ThreadGroup |
getParent()
getParent()
returns the parent of this ThreadGroup.
|
void |
interrupt()
interrupt()
This deprecated method calls the interrupt() method of every thread in
this group and in all of its child groups, recursively.
|
boolean |
isDaemon()
isDaemon()
returns the value of the `daemon' flag.
|
boolean |
isDestroyed()
isDestroyed()
returns true iff destroy() has already been called on this ThreadGroup.
|
void |
list()
list()
prints all the threads in this ThreadGroup and its descendants
on System.out.
|
boolean |
parentOf(ThreadGroup group)
parentOf(ThreadGroup group)
returns true iff the group in question is a direct or indirect child
of this ThreadGroup.
|
void |
resume()
resume()
This deprecated method calls the resume() method of every thread in
this group and in all of its child groups, recursively.
|
void |
setDaemon(boolean daemon)
setDaemon()
checks the caller's permissions before setting the `daemon' flag.
|
void |
setMaxPriority(int newMaxPriority)
setMaxPriority(int newMaxPriority)
checks its argument and the caller's permissions befor calling setMaxPriority0.
|
void |
stop()
stop()
This deprecated method calls the stop() method of every thread in
this group and in all of its child groups, recursively.
|
void |
suspend()
suspend()
This deprecated method calls the suspend() method of every thread in
this group and in all of its child groups, recursively.
|
String |
toString()
toString()
creates a String describing the ThreadGroup..
|
void |
uncaughtException(Thread t,
Throwable e)
uncaughtException(Thread t, Throwable e)
handles exceptions thrown by any thread in this group and not caught
by any exception handler in that thread's execution stack.
|
public ThreadGroup(String name) throws SecurityException
SecurityException
public ThreadGroup(ThreadGroup parent, String name) throws NullPointerException, SecurityException, IllegalThreadStateException
public String toString()
public final void checkAccess() throws SecurityException
SecurityException
public int activeCount()
public int activeGroupCount()
public int enumerate(ThreadGroup[] list)
public int enumerate(ThreadGroup[] list, boolean recursive)
public int enumerate(Thread[] threads)
public int enumerate(Thread[] threads, boolean recurse)
public final String getName()
public final ThreadGroup getParent()
public boolean isDestroyed()
public final boolean parentOf(ThreadGroup group)
public final void stop() throws SecurityException
SecurityException
public final void interrupt() throws SecurityException
SecurityException
public final void suspend() throws SecurityException
SecurityException
public final void resume() throws SecurityException
SecurityException
public final void destroy() throws SecurityException, IllegalThreadStateException
public final int getMaxPriority()
public final void setMaxPriority(int newMaxPriority) throws SecurityException, IllegalArgumentException
public final boolean isDaemon()
public final void setDaemon(boolean daemon) throws SecurityException
SecurityException
public void list()
public void uncaughtException(Thread t, Throwable e)
public boolean allowThreadSuspension(boolean b)