public class ThreadUtil extends Object
| Constructor and Description |
|---|
ThreadUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Thread[] |
getAllThreads()
Gets all threads in the JVM.
|
static Thread[] |
getAllThreadsMatching(String regex)
Gets all threads if its name matches a regular expression.
|
static ThreadGroup |
getRootThreadGroup()
Gets the "root" thread group for the entire JVM.
|
static Thread |
getThread(long id)
Gets a thread by its assigned ID.
|
public static ThreadGroup getRootThreadGroup()
public static Thread[] getAllThreads()
public static Thread getThread(long id)
id - The thread IDpublic static Thread[] getAllThreadsMatching(String regex)
regex - The regular expression to use when matching a threads name.
Same rules apply as String.matches() method.Copyright © 2012-2015 Cloudhopper by Twitter. All Rights Reserved.