com.caucho.util
Class ThreadDump

java.lang.Object
  extended by com.caucho.util.ThreadDump
Direct Known Subclasses:
ProThreadDump

public class ThreadDump
extends java.lang.Object

Generate a thread dump


Constructor Summary
protected ThreadDump()
           
 
Method Summary
protected  void buildThread(java.lang.StringBuilder sb, java.lang.management.ThreadInfo info, java.lang.management.ThreadInfo nextInfo)
           
protected  void buildThreads(java.lang.StringBuilder sb, java.lang.management.ThreadInfo[] infoArray, java.lang.Thread.State matchState, boolean isNative)
           
static ThreadDump create()
          Returns the singleton instance, creating if necessary.
 void dumpThreads()
          Log all threads to com.caucho.util.ThreadDump at info level.
 void dumpThreads(boolean onlyActive)
          Log threads to com.caucho.util.ThreadDump at info level.
 java.lang.String getThreadDump()
          Returns dump of all threads.
 java.lang.String getThreadDump(boolean onlyActive)
          Returns dump of threads.
 java.lang.String jsonThreadDump()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadDump

protected ThreadDump()
Method Detail

create

public static ThreadDump create()
Returns the singleton instance, creating if necessary. An instance of com.caucho.server.admin.ProThreadDump will be returned if available and licensed. ProThreadDump includes the URI of the request the thread is processing, if applicable.


dumpThreads

public void dumpThreads()
Log all threads to com.caucho.util.ThreadDump at info level. Uses cached dump if recent (30s).


getThreadDump

public java.lang.String getThreadDump()
Returns dump of all threads. Uses cached dump if recent (30s).


dumpThreads

public void dumpThreads(boolean onlyActive)
Log threads to com.caucho.util.ThreadDump at info level. Optionally uses cached dump.

Parameters:
onlyActive - if true only running threads are logged

getThreadDump

public java.lang.String getThreadDump(boolean onlyActive)
Returns dump of threads. Optionally uses cached dump.

Parameters:
onlyActive - if true only running threads are logged

buildThreads

protected void buildThreads(java.lang.StringBuilder sb,
                            java.lang.management.ThreadInfo[] infoArray,
                            java.lang.Thread.State matchState,
                            boolean isNative)

buildThread

protected void buildThread(java.lang.StringBuilder sb,
                           java.lang.management.ThreadInfo info,
                           java.lang.management.ThreadInfo nextInfo)

jsonThreadDump

public java.lang.String jsonThreadDump()