org.PingOO.DLAI.lib.util
Class PThreadGroup

java.lang.Object
  |
  +--java.lang.ThreadGroup
        |
        +--org.PingOO.DLAI.lib.util.PThreadGroup

public class PThreadGroup
extends java.lang.ThreadGroup

An extended thread group.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
ThreadGroup

Field Summary
private static PThreadGroup defaultGroup
          The default goup which will be at the root of the PingOO thread group tree.
private static int GROUP_COUNT
          The current number of groups.
private static int GROUP_NUMBER
          The group number generator.
private  int groupIdentifier
          The unique indentifier of the current group.
 
Fields inherited from class java.lang.ThreadGroup
daemon, destroyed, groups, maxPriority, name, ngroups, nthreads, parent, threads, vmAllowSuspension
 
Constructor Summary
private PThreadGroup()
          Creates a the default thread group.
private PThreadGroup(java.lang.String name)
          Creates a new thread group.
 
Method Summary
protected  void finalize()
          Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
static PThreadGroup getDefaultGroup()
          Returns the default group which is at the root of all PingOO threads and groups.
static int getInstanceNumber()
          Returns the number identifier of the last instancied group.
static PThreadGroup getNewInstance(java.lang.String name)
          Returns a new instance of a pgroup.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.ThreadGroup
activeCount, activeGroupCount, add, add, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, list, parentOf, remove, remove, resume, setDaemon, setMaxPriority, stop, suspend, uncaughtException
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

defaultGroup

private static PThreadGroup defaultGroup
The default goup which will be at the root of the PingOO thread group tree.

GROUP_NUMBER

private static int GROUP_NUMBER
The group number generator.

GROUP_COUNT

private static int GROUP_COUNT
The current number of groups.

groupIdentifier

private int groupIdentifier
The unique indentifier of the current group.
Constructor Detail

PThreadGroup

private PThreadGroup()
              throws java.lang.SecurityException
Creates a the default thread group.
Throws:
java.lang.SecurityException - If the current thread cannot create a thread in the specified thread group.

PThreadGroup

private PThreadGroup(java.lang.String name)
              throws java.lang.NullPointerException,
                     java.lang.SecurityException
Creates a new thread group.
The parent of this new group is the specified thread group.
Parameters:
name - The name of the new group.
Throws:
java.lang.NullPointerException - If the thread group argument is null.
java.lang.SecurityException - If the current thread cannot create a thread in the specified thread group.
Method Detail

getNewInstance

public static PThreadGroup getNewInstance(java.lang.String name)
                                   throws java.lang.NullPointerException,
                                          java.lang.SecurityException
Returns a new instance of a pgroup.
Parameters:
name - The name of the new group.
Returns:
A new instance of a pgroup, null in case of problems.

getDefaultGroup

public static PThreadGroup getDefaultGroup()
Returns the default group which is at the root of all PingOO threads and groups.
Returns:
The default group which is at the root of all PingOO threads and groups.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.ThreadGroup

getInstanceNumber

public static int getInstanceNumber()
Returns the number identifier of the last instancied group.
Returns:
The number identifier of the last instancied group.

finalize

protected void finalize()
                 throws java.lang.Throwable
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
Overrides:
finalize in class java.lang.Object