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 interfaceThreadDumpMessage.ThreadInfoFactoryFactory 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 voidformatTo(StringBuilder sb)Writes a text representation of this object into the specifiedStringBuilder, ideally without allocating temporary objects.StringgetFormat()Returns the title.StringgetFormattedMessage()Returns the ThreadDump in printable format.Object[]getParameters()Returns an array with a single element, a Map containing the ThreadInformation as the key.ThrowablegetThrowable()Always returns null.StringtoString()protected ObjectwriteReplace()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:
getFormattedMessagein interfaceMessage- Returns:
- the ThreadDump suitable for logging.
-
formatTo
public void formatTo(StringBuilder sb)
Description copied from interface:StringBuilderFormattableWrites a text representation of this object into the specifiedStringBuilder, ideally without allocating temporary objects.- Specified by:
formatToin 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:
getParametersin 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:
getThrowablein interfaceMessage- Returns:
- null
-
-