Package org.jppf.management.diagnostics
Class ThreadDump
java.lang.Object
org.jppf.management.diagnostics.ThreadDump
- All Implemented Interfaces:
Serializable
This class encapsulates a JVM thread dump, including deadlocks information when available.
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionThreadDump(ThreadMXBean threadMXBean) Create this thread dump from the specified thread mxbean. -
Method Summary
Modifier and TypeMethodDescriptionlong[]Get the ids of the deadlock threads, if any.Get information on the threads.toHTMLString(String title, boolean includeBody, int fontSize) Print this thread dump to an HTML formatted string.toPlainTextString(String title) Print this thread dump to a plain text formatted string.toString()
-
Constructor Details
-
ThreadDump
Create this thread dump from the specified thread mxbean.- Parameters:
threadMXBean- the thread MXBean to get the information from.
-
-
Method Details
-
getThreads
Get information on the threads.- Returns:
- a mapping of
ThreadInformationobjects to their thread id, ornullif 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
longvalues, ornullif none exists.
-
toString
-
toPlainTextString
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
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.
-