Keel 2.1RC2

org.keel.util.thread
Class ThreadUtil

java.lang.Object
  extended byorg.keel.util.thread.ThreadUtil

public class ThreadUtil
extends java.lang.Object

Author:
pjbrown To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Constructor Summary
private ThreadUtil()
           
 
Method Summary
static java.lang.Thread findThread(java.lang.Thread threadToSearch, java.lang.String groupName, java.lang.String contains1, java.lang.String contains2, boolean recurseThroughSubGroups)
          Searches the current threadgroup and all its parent thread groups to find a thread group that contains the name groupName (case insensitive).
private static java.lang.ThreadGroup findThreadGroup(java.lang.Thread threadToSearch, java.lang.String groupName)
          Looks through the ThreadGroup of threadToSearch and all of it's parent threadGroups.
private static java.util.List listThreads(java.lang.ThreadGroup tGroup, boolean recurse)
          Creates and returns a list of all threads contained within tGroup.
static void print(java.lang.String string)
           
static void showInfo()
           
static void showInfo(java.lang.Thread thread)
           
static void showThreads(java.lang.ThreadGroup tGroup)
           
static void showThreads(java.lang.ThreadGroup tGroup, boolean recurseThroughParents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadUtil

private ThreadUtil()
Method Detail

showInfo

public static final void showInfo()

showInfo

public static final void showInfo(java.lang.Thread thread)

showThreads

public static final void showThreads(java.lang.ThreadGroup tGroup)

showThreads

public static final void showThreads(java.lang.ThreadGroup tGroup,
                                     boolean recurseThroughParents)

print

public static final void print(java.lang.String string)

findThread

public static final java.lang.Thread findThread(java.lang.Thread threadToSearch,
                                                java.lang.String groupName,
                                                java.lang.String contains1,
                                                java.lang.String contains2,
                                                boolean recurseThroughSubGroups)
Searches the current threadgroup and all its parent thread groups to find a thread group that contains the name groupName (case insensitive). It then searches all threads that are directly in that thread group to find a thread that contains the strings contains1 and contains2 (also case insensitive). It returns the first thread it finds that meets this criteria. If no thread meets this criteria then it returns null; If contains2 is an empty string or contains2 is null, then it only checks for a match in contains1.


listThreads

private static java.util.List listThreads(java.lang.ThreadGroup tGroup,
                                          boolean recurse)
Creates and returns a list of all threads contained within tGroup. If recurse == true, then it includes all threads within sub-groups of tGroup. If no threads are found or if tGroup is null then it returns an empty list.

Parameters:
tGroup -
Returns:

findThreadGroup

private static java.lang.ThreadGroup findThreadGroup(java.lang.Thread threadToSearch,
                                                     java.lang.String groupName)
Looks through the ThreadGroup of threadToSearch and all of it's parent threadGroups. Returns the first threadGroup found that contains groupName (case insensitive match). If no threadgroup is found to match, or if groupName is null or the empty string, then this method returns null.

Parameters:
threadToSearch -
groupName -
Returns:

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.