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 class
Factory to create basic thread information.private static class
Proxy pattern used to serialize the ThreadDumpMessage.static interface
Factory to create Thread information. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ThreadDumpMessage.ThreadInfoFactory
private String
private static final long
private Map
<ThreadInformation, StackTraceElement[]> private final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionThreadDumpMessage
(String title) Generate a ThreadDumpMessage with a title.private
ThreadDumpMessage
(String formattedMsg, String title) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Writes a text representation of this object into the specifiedStringBuilder
, ideally without allocating temporary objects.private static ThreadDumpMessage.ThreadInfoFactory
Returns 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.ThreadInfoFactory
initFactory
(ClassLoader classLoader) private void
readObject
(ObjectInputStream stream) toString()
protected Object
Creates 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:
getFormattedMessage
in interfaceMessage
- Returns:
- the ThreadDump suitable for logging.
-
formatTo
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
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:
getParameters
in 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:
getThrowable
in interfaceMessage
- Returns:
- null
-