public class ThrowableCallStack extends Object implements CallStack
Throwable
. While being the most portable method of
obtaining the current call stack, this is also the slowest way to do it. In environments where a new SecurityManager
can be created, it is preferred to use SecurityManagerCallStack
.Throwable.fillInStackTrace()
Constructor and Description |
---|
ThrowableCallStack(String messageFormat,
boolean useTimestamp) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the current stack trace snapshot.
|
void |
fillInStackTrace()
Takes a snapshot of the current call stack.
|
boolean |
printStackTrace(PrintWriter writer)
Prints the current stack trace if available to a PrintWriter.
|
public ThrowableCallStack(String messageFormat, boolean useTimestamp)
public boolean printStackTrace(PrintWriter writer)
CallStack
PooledObject
usage in user code.printStackTrace
in interface CallStack
writer
- a PrintWriter to write the curren stack trace to if availablepublic void fillInStackTrace()
CallStack
CallStack.printStackTrace(PrintWriter)
will print
out that stack trace until it is cleared.fillInStackTrace
in interface CallStack
public void clear()
CallStack
CallStack.printStackTrace(PrintWriter)
will be
no-ops until another call to CallStack.fillInStackTrace()
.Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.