Top Description Methods
org.apache.commons.pool2.impl

public Interface CallStack

Known Direct Implementers
org.apache.commons.pool2.impl.NoOpCallStack, org.apache.commons.pool2.impl.SecurityManagerCallStack, org.apache.commons.pool2.impl.ThrowableCallStack
Imports
java.io.PrintWriter, org.apache.commons.pool2.PooledObject, .UsageTracking

Strategy for obtaining and printing the current call stack. This is primarily useful for usage tracking so that different JVMs and configurations can use more efficient strategies for obtaining the current call stack depending on metadata needs.
Since
2.4.3
See Also
CallStackUtils

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clears the current stack trace snapshot.

public void
fillInStackTrace()

Takes a snapshot of the current call stack.

public boolean

Returns:

true if a stack trace was available to print or false if nothing was printed
printStackTrace
(final PrintWriter
a PrintWriter to write the current stack trace to if available
writer
)

Prints the current stack trace if available to a PrintWriter.

Method Detail

clearback to summary
public void clear()

Clears the current stack trace snapshot. Subsequent calls to printStackTrace(PrintWriter) will be no-ops until another call to fillInStackTrace().

fillInStackTraceback to summary
public void fillInStackTrace()

Takes a snapshot of the current call stack. Subsequent calls to printStackTrace(PrintWriter) will print out that stack trace until it is cleared.

printStackTraceback to summary
public boolean printStackTrace(final PrintWriter writer)

Prints the current stack trace if available to a PrintWriter. The format is undefined and is primarily useful for debugging issues with PooledObject usage in user code.

Parameters
writer:PrintWriter

a PrintWriter to write the current stack trace to if available

Returns:boolean

true if a stack trace was available to print or false if nothing was printed