public class StaticThrowableStorage
extends java.lang.Throwable
StaticThrowable
. This call is visible
so that an application can extend an existing conventional Java throwable
and still implement StaticThrowable
; its methods can be implemented
using the methods defined in this class. An application defined throwable
that does not need to extend an existing conventional Java throwable should
extend one of StaticCheckedException
, StaticRuntimeException
,
or StaticError
instead.Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
fillInStackTrace()
Captures the current thread's stack trace and saves it in thread
local storage.
|
java.lang.Throwable |
getCause()
Gets the cause from thread local storage that was saved by the last
preallocated exception thrown.
|
static StaticThrowableStorage |
getCurrent()
A means of obtaining the storage object for the current task and throwable.
|
StaticThrowable<?> |
getLastThrown()
Determine for what throwable the data is valid;
|
java.lang.String |
getLocalizedMessage() |
java.lang.String |
getMessage()
Gets the message from thread local storage that was saved by the last
preallocated exception thrown.
|
java.lang.StackTraceElement[] |
getStackTrace()
Gets the stack trace from thread local storage that was saved by the last
preallocated exception thrown.
|
java.lang.Throwable |
initCause(java.lang.Throwable cause)
Saves the message in thread local storage for later retrieval.
|
static StaticThrowableStorage |
initCurrent(StaticThrowable<?> throwable)
Obtaining the storage object for the current task and initialize it.
|
StaticThrowableStorage |
initMessage(java.lang.String message)
Saves the message in thread local storage for later retrieval.
|
void |
printStackTrace() |
void |
printStackTrace(java.io.PrintStream stream) |
void |
printStackTrace(java.io.PrintWriter writer) |
void |
setStackTrace(java.lang.StackTraceElement[] stackTrace) |
StaticThrowable |
transfer()
Transfer the contents of a StaticThrowableStorage to the current
thread context.
|
public static StaticThrowableStorage getCurrent()
public static StaticThrowableStorage initCurrent(StaticThrowable<?> throwable)
public StaticThrowable<?> getLastThrown()
public java.lang.Throwable fillInStackTrace()
fillInStackTrace
in class java.lang.Throwable
this
NYI: UNDER DEVELOPMENT: JAM-5543 Implementation Under Construction
--- this should be done on the native side to avoid allocation.public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public StaticThrowableStorage initMessage(java.lang.String message)
message
- The description to save.this
public java.lang.Throwable getCause()
getCause
in class java.lang.Throwable
null
when none was set.public java.lang.Throwable initCause(java.lang.Throwable cause)
initCause
in class java.lang.Throwable
cause
- In the case of cascading throwables, the
exception or error that was the original cause.this
public java.lang.StackTraceElement[] getStackTrace()
getStackTrace
in class java.lang.Throwable
public java.lang.String getLocalizedMessage()
getLocalizedMessage
in class java.lang.Throwable
public StaticThrowable transfer()
public void setStackTrace(java.lang.StackTraceElement[] stackTrace)
setStackTrace
in class java.lang.Throwable
public void printStackTrace()
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintStream stream)
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintWriter writer)
printStackTrace
in class java.lang.Throwable