public class CallerTrace
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
|
CallerTrace()
Constructs a new
CallerTrace for the current thread and its current
stack trace. |
|
CallerTrace(int trimStackTrace)
Constructs a new
CallerTrace for the current thread and its current
stack trace. |
protected |
CallerTrace(java.lang.StackTraceElement[] threadStack,
java.lang.Thread thread,
int trimStackTrace)
Creates a new
CallerTrace for the designated stack trace,
thread and trims the stack appropriately. |
|
CallerTrace(java.lang.Thread thread)
Constructs a new
CallerTrace for the given thread and its current
stack trace. |
|
CallerTrace(java.lang.Thread thread,
int trimStackTrace)
Constructs a new
CallerTrace for the given thread and its current
stack trace. |
|
CallerTrace(java.lang.Thread thread,
java.lang.StackTraceElement[] stackTrace)
Constructs a new
CallerTrace for the given thread and the given
stack trace. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.StackTraceElement[] |
getStackTrace()
Returns the thread's stack trace at the time of calling.
|
java.lang.Thread |
getThread()
Returns the calling thread.
|
java.lang.String |
getThreadName()
Returns the name of the calling thread.
|
long |
getTimestamp()
Returns a timestamp of when this trace was created.
|
public CallerTrace()
CallerTrace for the current thread and its current
stack trace.public CallerTrace(java.lang.Thread thread)
CallerTrace for the given thread and its current
stack trace. Thread.currentThread(). Use the constructors without
Thread-parameter instead.thread - the thread for which to create the tracepublic CallerTrace(int trimStackTrace)
CallerTrace for the current thread and its current
stack trace. The top trimStackTrace stack trace elements are cut
off.trimStackTrace - the number of stack trace elements (from the top)
that should be cut offpublic CallerTrace(java.lang.Thread thread,
int trimStackTrace)
CallerTrace for the given thread and its current
stack trace. The top trimStackTrace stack trace elements are cut
off. Thread.currentThread(). Use the constructors without
Thread-parameter instead.thread - the thread for which to create the tracetrimStackTrace - the number of stack trace elements (from the top)
that should be cut offpublic CallerTrace(java.lang.Thread thread,
java.lang.StackTraceElement[] stackTrace)
CallerTrace for the given thread and the given
stack trace.thread - the thread for which to create the tracestackTrace - the stack trace to be loggedprotected CallerTrace(java.lang.StackTraceElement[] threadStack,
java.lang.Thread thread,
int trimStackTrace)
CallerTrace for the designated stack trace,
thread and trims the stack appropriately.threadStack - The stack trace to be logged.thread - The thread for which to create the trace.trimStackTrace - The number of stack trace elements (from the top)
that should be cut off.public java.lang.Thread getThread()
weak reference, i.e. this trace does not prevent the
thread from being garbage collected.null if the thread was already
garbage collectedpublic java.lang.String getThreadName()
public java.lang.StackTraceElement[] getStackTrace()
public long getTimestamp()