java.lang
Class ThreadGroup

java.lang.Object
  extended byjava.lang.ThreadGroup

public class ThreadGroup
extends java.lang.Object

Author:
josson smith 2006-5-5

Constructor Summary
ThreadGroup(java.lang.String name)
          Constructs a new thread group.
ThreadGroup(ThreadGroup parent, java.lang.String name)
          Creates a new thread group.
 
Method Summary
 int getMaxPriority()
          Returns the maximum priority of this thread group.
 java.lang.String getName()
          Returns the name of this thread group.
 ThreadGroup getParent()
          Returns the parent of this thread group.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadGroup

public ThreadGroup(java.lang.String name)
Constructs a new thread group. The parent of this new group is the thread group of the currently running thread.

The checkAccess method of the parent thread group is called with no arguments; this may result in a security exception.

Parameters:
name - the name of the new thread group.
Throws:
SecurityException - if the current thread cannot create a thread in the specified thread group.
Since:
JDK1.0
See Also:
java.lang.ThreadGroup#checkAccess()

ThreadGroup

public ThreadGroup(ThreadGroup parent,
                   java.lang.String name)
Creates a new thread group. The parent of this new group is the specified thread group.

The checkAccess method of the parent thread group is called with no arguments; this may result in a security exception.

Parameters:
parent - the parent thread group.
name - the name of the new thread group.
Throws:
NullPointerException - if the thread group argument is null.
SecurityException - if the current thread cannot create a thread in the specified thread group.
Since:
JDK1.0
See Also:
SecurityException, java.lang.ThreadGroup#checkAccess()
Method Detail

getName

public final java.lang.String getName()
Returns the name of this thread group.

Returns:
the name of this thread group.
Since:
JDK1.0

getParent

public final ThreadGroup getParent()
Returns the parent of this thread group.

First, if the parent is not null, the checkAccess method of the parent thread group is called with no arguments; this may result in a security exception.

Returns:
the parent of this thread group. The top-level thread group is the only thread group whose parent is null.
Throws:
SecurityException - if the current thread cannot modify this thread group.
Since:
JDK1.0
See Also:
java.lang.ThreadGroup#checkAccess(), SecurityException, RuntimePermission

getMaxPriority

public final int getMaxPriority()
Returns the maximum priority of this thread group. Threads that are part of this group cannot have a higher priority than the maximum priority.

Returns:
the maximum priority that a thread in this thread group can have.
Since:
JDK1.0
See Also:
#setMaxPriority