Class ThreadDump

java.lang.Object
org.jppf.management.diagnostics.ThreadDump
All Implemented Interfaces:
Serializable

public class ThreadDump extends Object implements Serializable
This class encapsulates a JVM thread dump, including deadlocks information when available.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • ThreadDump

      public ThreadDump(ThreadMXBean threadMXBean)
      Create this thread dump from the specified thread mxbean.
      Parameters:
      threadMXBean - the thread MXBean to get the information from.
  • Method Details

    • getThreads

      public Map<Long,ThreadInformation> getThreads()
      Get information on the threads.
      Returns:
      a mapping of ThreadInformation objects to their thread id, or null if no thread information is available.
    • getDeadlockedThreads

      public long[] getDeadlockedThreads()
      Get the ids of the deadlock threads, if any.
      Returns:
      the ids as an array of long values, or null if none exists.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toPlainTextString

      public String toPlainTextString(String title)
      Print this thread dump to a plain text formatted string.
      Parameters:
      title - the title given to the thread dump.
      Returns:
      the thread dump printed to a plain test formatted string, or null if it could not be printed.
    • toHTMLString

      public String toHTMLString(String title, boolean includeBody, int fontSize)
      Print this thread dump to an HTML formatted string.
      Parameters:
      title - the title given to the thread dump.
      includeBody - whether to add the <html> and <body> tags.
      fontSize - the size of the font used to write the thread dump.
      Returns:
      the thread dump printed to an HTML string, or null if it could not be printed.