public class SecurityManagerCallStack extends java.lang.Object implements CallStack
SecurityManager
. Obtaining the current call stack is much faster via a
SecurityManger, but access to the underlying method may be restricted by the current SecurityManager. In environments
where a SecurityManager cannot be created, ThrowableCallStack
should be used instead.RuntimePermission
,
SecurityManager.getClassContext()
Constructor and Description |
---|
SecurityManagerCallStack(java.lang.String messageFormat,
boolean useTimestamp)
Create a new instance.
|
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(java.io.PrintWriter writer)
Prints the current stack trace if available to a PrintWriter.
|
public SecurityManagerCallStack(java.lang.String messageFormat, boolean useTimestamp)
messageFormat
- message formatuseTimestamp
- whether to format the dates in the output message or notpublic boolean printStackTrace(java.io.PrintWriter writer)
CallStack
PooledObject
usage in user code.printStackTrace
in interface CallStack
writer
- a PrintWriter to write the current 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 © 2000-2018 Apache Software Foundation. All Rights Reserved.