Class SecurityManagerCallStack
java.lang.Object
org.apache.tomcat.dbcp.pool2.impl.SecurityManagerCallStack
- All Implemented Interfaces:
CallStack
A
CallStack
strategy using a 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.- Since:
- 2.4.3
- See Also:
-
Constructor Summary
ConstructorDescriptionSecurityManagerCallStack
(String messageFormat, boolean useTimestamp) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the current stack trace snapshot.void
Takes a snapshot of the current call stack.boolean
printStackTrace
(PrintWriter writer) Prints the current stack trace if available to a PrintWriter.
-
Constructor Details
-
SecurityManagerCallStack
Creates a new instance.- Parameters:
messageFormat
- message formatuseTimestamp
- whether to format the dates in the output message or not
-
-
Method Details
-
clear
public void clear()Description copied from interface:CallStack
Clears the current stack trace snapshot. Subsequent calls toCallStack.printStackTrace(PrintWriter)
will be no-ops until another call toCallStack.fillInStackTrace()
. -
fillInStackTrace
public void fillInStackTrace()Description copied from interface:CallStack
Takes a snapshot of the current call stack. Subsequent calls toCallStack.printStackTrace(PrintWriter)
will print out that stack trace until it is cleared.- Specified by:
fillInStackTrace
in interfaceCallStack
-
printStackTrace
Description copied from interface:CallStack
Prints the current stack trace if available to a PrintWriter. The format is undefined and is primarily useful for debugging issues withPooledObject
usage in user code.- Specified by:
printStackTrace
in interfaceCallStack
- Parameters:
writer
- a PrintWriter to write the current stack trace to if available- Returns:
- true if a stack trace was available to print or false if nothing was printed
-