Class ThrowableProxy
- java.lang.Object
-
- org.apache.logging.log4j.core.impl.ThrowableProxy
-
- All Implemented Interfaces:
Serializable
@Deprecated public class ThrowableProxy extends Object implements Serializable
Deprecated.Wraps a Throwable to add packaging information about each stack trace element.A proxy is used to represent a throwable that may not exist in a different class loader or JVM. When an application deserializes a ThrowableProxy, the throwable may not be set, but the throwable's information is preserved in other fields of the proxy like the message and stack trace.
TODO: Move this class to org.apache.logging.log4j.core because it is used from LogEvent.
TODO: Deserialize: Try to rebuild Throwable if the target exception is in this class loader?
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ThrowableProxy(Throwable throwable)Deprecated.Constructs the wrapper for the Throwable that includes packaging data.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)Deprecated.voidformatExtendedStackTraceTo(StringBuilder sb, List<String> ignorePackages, TextRenderer textRenderer, String suffix, String lineSeparator)Deprecated.Formats the stack trace including packaging information.voidformatWrapper(StringBuilder sb, ThrowableProxy cause, String suffix)Deprecated.Formats the specified Throwable.voidformatWrapper(StringBuilder sb, ThrowableProxy cause, List<String> ignorePackages, String suffix)Deprecated.Formats the specified Throwable.voidformatWrapper(StringBuilder sb, ThrowableProxy cause, List<String> ignorePackages, TextRenderer textRenderer, String suffix)Deprecated.Formats the specified Throwable.voidformatWrapper(StringBuilder sb, ThrowableProxy cause, List<String> ignorePackages, TextRenderer textRenderer, String suffix, String lineSeparator)Deprecated.Formats the specified Throwable.ThrowableProxygetCauseProxy()Deprecated.StringgetCauseStackTraceAsString(String suffix)Deprecated.Formats the Throwable that is the cause of this Throwable.StringgetCauseStackTraceAsString(List<String> packages, String suffix)Deprecated.Formats the Throwable that is the cause of this Throwable.StringgetCauseStackTraceAsString(List<String> ignorePackages, TextRenderer textRenderer, String suffix)Deprecated.Formats the Throwable that is the cause of this Throwable.StringgetCauseStackTraceAsString(List<String> ignorePackages, TextRenderer textRenderer, String suffix, String lineSeparator)Deprecated.Formats the Throwable that is the cause of this Throwable.intgetCommonElementCount()Deprecated.Returns the number of elements that are being omitted because they are common with the parent Throwable's stack trace.ExtendedStackTraceElement[]getExtendedStackTrace()Deprecated.Gets the stack trace including packaging information.StringgetExtendedStackTraceAsString()Deprecated.Formats the stack trace including packaging information.StringgetExtendedStackTraceAsString(String suffix)Deprecated.Formats the stack trace including packaging information.StringgetExtendedStackTraceAsString(List<String> ignorePackages, String suffix)Deprecated.Formats the stack trace including packaging information.StringgetExtendedStackTraceAsString(List<String> ignorePackages, TextRenderer textRenderer, String suffix)Deprecated.Formats the stack trace including packaging information.StringgetExtendedStackTraceAsString(List<String> ignorePackages, TextRenderer textRenderer, String suffix, String lineSeparator)Deprecated.Formats the stack trace including packaging information.StringgetLocalizedMessage()Deprecated.StringgetMessage()Deprecated.StringgetName()Deprecated.Return the FQCN of the Throwable.StackTraceElement[]getStackTrace()Deprecated.ThrowableProxy[]getSuppressedProxies()Deprecated.Gets proxies for suppressed exceptions.StringgetSuppressedStackTrace(String suffix)Deprecated.Formats the suppressed Throwables.ThrowablegetThrowable()Deprecated.The throwable or null if this object is deserialized from XML or JSON.inthashCode()Deprecated.StringtoString()Deprecated.
-
-
-
Constructor Detail
-
ThrowableProxy
public ThrowableProxy(Throwable throwable)
Deprecated.Constructs the wrapper for the Throwable that includes packaging data.- Parameters:
throwable- The Throwable to wrap, must not be null.
-
-
Method Detail
-
formatWrapper
public void formatWrapper(StringBuilder sb, ThrowableProxy cause, String suffix)
Deprecated.Formats the specified Throwable.- Parameters:
sb- StringBuilder to contain the formatted Throwable.cause- The Throwable to format.suffix- Append this to the end of each stack frame.
-
formatWrapper
public void formatWrapper(StringBuilder sb, ThrowableProxy cause, List<String> ignorePackages, String suffix)
Deprecated.Formats the specified Throwable.- Parameters:
sb- StringBuilder to contain the formatted Throwable.cause- The Throwable to format.ignorePackages- The List of packages to be suppressed from the trace.suffix- Append this to the end of each stack frame.
-
formatWrapper
public void formatWrapper(StringBuilder sb, ThrowableProxy cause, List<String> ignorePackages, TextRenderer textRenderer, String suffix)
Deprecated.Formats the specified Throwable.- Parameters:
sb- StringBuilder to contain the formatted Throwable.cause- The Throwable to format.ignorePackages- The List of packages to be suppressed from the stack trace.textRenderer- The text renderer.suffix- Append this to the end of each stack frame.
-
formatWrapper
public void formatWrapper(StringBuilder sb, ThrowableProxy cause, List<String> ignorePackages, TextRenderer textRenderer, String suffix, String lineSeparator)
Deprecated.Formats the specified Throwable.- Parameters:
sb- StringBuilder to contain the formatted Throwable.cause- The Throwable to format.ignorePackages- The List of packages to be suppressed from the stack trace.textRenderer- The text renderer.suffix- Append this to the end of each stack frame.lineSeparator- The end-of-line separator.
-
getCauseProxy
public ThrowableProxy getCauseProxy()
Deprecated.
-
getCauseStackTraceAsString
public String getCauseStackTraceAsString(String suffix)
Deprecated.Formats the Throwable that is the cause of this Throwable.- Parameters:
suffix- Append this to the end of each stack frame.- Returns:
- The formatted Throwable that caused this Throwable.
-
getCauseStackTraceAsString
public String getCauseStackTraceAsString(List<String> packages, String suffix)
Deprecated.Formats the Throwable that is the cause of this Throwable.- Parameters:
packages- The List of packages to be suppressed from the trace.suffix- Append this to the end of each stack frame.- Returns:
- The formatted Throwable that caused this Throwable.
-
getCauseStackTraceAsString
public String getCauseStackTraceAsString(List<String> ignorePackages, TextRenderer textRenderer, String suffix)
Deprecated.Formats the Throwable that is the cause of this Throwable.- Parameters:
ignorePackages- The List of packages to be suppressed from the trace.textRenderer- The text renderer.suffix- Append this to the end of each stack frame.- Returns:
- The formatted Throwable that caused this Throwable.
-
getCauseStackTraceAsString
public String getCauseStackTraceAsString(List<String> ignorePackages, TextRenderer textRenderer, String suffix, String lineSeparator)
Deprecated.Formats the Throwable that is the cause of this Throwable.- Parameters:
ignorePackages- The List of packages to be suppressed from the stack trace.textRenderer- The text renderer.suffix- Append this to the end of each stack frame.lineSeparator- The end-of-line separator.- Returns:
- The formatted Throwable that caused this Throwable.
-
getCommonElementCount
public int getCommonElementCount()
Deprecated.Returns the number of elements that are being omitted because they are common with the parent Throwable's stack trace.- Returns:
- The number of elements omitted from the stack trace.
-
getExtendedStackTrace
public ExtendedStackTraceElement[] getExtendedStackTrace()
Deprecated.Gets the stack trace including packaging information.- Returns:
- The stack trace including packaging information.
-
getExtendedStackTraceAsString
public String getExtendedStackTraceAsString()
Deprecated.Formats the stack trace including packaging information.- Returns:
- The formatted stack trace including packaging information.
-
getExtendedStackTraceAsString
public String getExtendedStackTraceAsString(String suffix)
Deprecated.Formats the stack trace including packaging information.- Parameters:
suffix- Append this to the end of each stack frame.- Returns:
- The formatted stack trace including packaging information.
-
getExtendedStackTraceAsString
public String getExtendedStackTraceAsString(List<String> ignorePackages, String suffix)
Deprecated.Formats the stack trace including packaging information.- Parameters:
ignorePackages- List of packages to be ignored in the trace.suffix- Append this to the end of each stack frame.- Returns:
- The formatted stack trace including packaging information.
-
getExtendedStackTraceAsString
public String getExtendedStackTraceAsString(List<String> ignorePackages, TextRenderer textRenderer, String suffix)
Deprecated.Formats the stack trace including packaging information.- Parameters:
ignorePackages- List of packages to be ignored in the trace.textRenderer- The message renderer.suffix- Append this to the end of each stack frame.- Returns:
- The formatted stack trace including packaging information.
-
getExtendedStackTraceAsString
public String getExtendedStackTraceAsString(List<String> ignorePackages, TextRenderer textRenderer, String suffix, String lineSeparator)
Deprecated.Formats the stack trace including packaging information.- Parameters:
ignorePackages- List of packages to be ignored in the trace.textRenderer- The message renderer.suffix- Append this to the end of each stack frame.lineSeparator- The end-of-line separator.- Returns:
- The formatted stack trace including packaging information.
-
formatExtendedStackTraceTo
public void formatExtendedStackTraceTo(StringBuilder sb, List<String> ignorePackages, TextRenderer textRenderer, String suffix, String lineSeparator)
Deprecated.Formats the stack trace including packaging information.- Parameters:
sb- Destination.ignorePackages- List of packages to be ignored in the trace.textRenderer- The message renderer.suffix- Append this to the end of each stack frame.lineSeparator- The end-of-line separator.
-
getLocalizedMessage
public String getLocalizedMessage()
Deprecated.
-
getMessage
public String getMessage()
Deprecated.
-
getName
public String getName()
Deprecated.Return the FQCN of the Throwable.- Returns:
- The FQCN of the Throwable.
-
getStackTrace
public StackTraceElement[] getStackTrace()
Deprecated.
-
getSuppressedProxies
public ThrowableProxy[] getSuppressedProxies()
Deprecated.Gets proxies for suppressed exceptions.- Returns:
- proxies for suppressed exceptions.
-
getSuppressedStackTrace
public String getSuppressedStackTrace(String suffix)
Deprecated.Formats the suppressed Throwables.- Parameters:
suffix- Append this to the end of each stack frame.- Returns:
- The formatted suppressed Throwables.
-
getThrowable
public Throwable getThrowable()
Deprecated.The throwable or null if this object is deserialized from XML or JSON.- Returns:
- The throwable or null if this object is deserialized from XML or JSON.
-
-