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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classFactory to create basic thread information.private static classProxy pattern used to serialize the ThreadDumpMessage.static interfaceFactory to create Thread information. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ThreadDumpMessage.ThreadInfoFactoryprivate Stringprivate static final longprivate Map<ThreadInformation, StackTraceElement[]> private final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionThreadDumpMessage(String title) Generate a ThreadDumpMessage with a title.privateThreadDumpMessage(String formattedMsg, String title) -
Method Summary
Modifier and TypeMethodDescriptionvoidWrites a text representation of this object into the specifiedStringBuilder, ideally without allocating temporary objects.private static ThreadDumpMessage.ThreadInfoFactoryReturns the title.Returns the ThreadDump in printable format.Object[]Returns an array with a single element, a Map containing the ThreadInformation as the key.Always returns null.private static ThreadDumpMessage.ThreadInfoFactoryinitFactory(ClassLoader classLoader) private voidreadObject(ObjectInputStream stream) toString()protected ObjectCreates a ThreadDumpMessageProxy that can be serialized.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
FACTORY
-
threads
-
title
-
formattedMessage
-
-
Constructor Details
-
ThreadDumpMessage
Generate a ThreadDumpMessage with a title.- Parameters:
title- The title.
-
ThreadDumpMessage
-
-
Method Details
-
getFactory
-
initFactory
-
toString
-
getFormattedMessage
Returns the ThreadDump in printable format.- Specified by:
getFormattedMessagein interfaceMessage- Returns:
- the ThreadDump suitable for logging.
-
formatTo
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
Returns the title. -
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
Creates a ThreadDumpMessageProxy that can be serialized.- Returns:
- a ThreadDumpMessageProxy.
-
readObject
- Throws:
InvalidObjectException
-
getThrowable
Always returns null.- Specified by:
getThrowablein interfaceMessage- Returns:
- null
-