Package org.apache.logging.log4j.message
Class ThreadDumpMessage
- java.lang.Object
-
- org.apache.logging.log4j.message.ThreadDumpMessage
-
- All Implemented Interfaces:
Serializable
,Message
,StringBuilderFormattable
@AsynchronouslyFormattable public class ThreadDumpMessage extends Object implements Message, StringBuilderFormattable
Captures information about all running Threads.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ThreadDumpMessage.ThreadInfoFactory
Factory to create Thread information.
-
Constructor Summary
Constructors Constructor Description ThreadDumpMessage(String title)
Generate a ThreadDumpMessage with a title.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
formatTo(StringBuilder sb)
Writes a text representation of this object into the specifiedStringBuilder
, ideally without allocating temporary objects.String
getFormat()
Returns the title.String
getFormattedMessage()
Returns the ThreadDump in printable format.Object[]
getParameters()
Returns an array with a single element, a Map containing the ThreadInformation as the key.Throwable
getThrowable()
Always returns null.String
toString()
protected Object
writeReplace()
Creates a ThreadDumpMessageProxy that can be serialized.
-
-
-
Constructor Detail
-
ThreadDumpMessage
public ThreadDumpMessage(String title)
Generate a ThreadDumpMessage with a title.- Parameters:
title
- The title.
-
-
Method Detail
-
getFormattedMessage
public String getFormattedMessage()
Returns the ThreadDump in printable format.- Specified by:
getFormattedMessage
in interfaceMessage
- Returns:
- the ThreadDump suitable for logging.
-
formatTo
public void formatTo(StringBuilder sb)
Description copied from interface:StringBuilderFormattable
Writes a text representation of this object into the specifiedStringBuilder
, ideally without allocating temporary objects.- Specified by:
formatTo
in interfaceStringBuilderFormattable
- Parameters:
sb
- the StringBuilder to write into
-
getFormat
public String getFormat()
Returns the title.
-
getParameters
public Object[] getParameters()
Returns an array with a single element, a Map containing the ThreadInformation as the key. and the StackTraceElement array as the value;- Specified by:
getParameters
in interfaceMessage
- Returns:
- the "parameters" to this Message.
-
writeReplace
protected Object writeReplace()
Creates a ThreadDumpMessageProxy that can be serialized.- Returns:
- a ThreadDumpMessageProxy.
-
getThrowable
public Throwable getThrowable()
Always returns null.- Specified by:
getThrowable
in interfaceMessage
- Returns:
- null
-
-