Class ThrowableCallStack

  • All Implemented Interfaces:

    public class ThrowableCallStack
    extends java.lang.Object
    implements CallStack
    CallStack strategy that uses the stack trace from a Throwable. This strategy, while slower than the SecurityManager implementation, provides call stack method names and other metadata in addition to the call stack of classes.
    See Also:
    • Constructor Summary

      Constructor Description
      ThrowableCallStack​(java.lang.String messageFormat, boolean useTimestamp)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clears the current stack trace snapshot.
      void fillInStackTrace()
      Takes a snapshot of the current call stack.
      boolean printStackTrace​( writer)
      Prints the current stack trace if available to a PrintWriter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThrowableCallStack

        public ThrowableCallStack​(java.lang.String messageFormat,
                                  boolean useTimestamp)
        Creates a new instance.
        messageFormat - message format
        useTimestamp - whether to format the dates in the output message or not
    • Method Detail

      • printStackTrace

        public boolean printStackTrace​( writer)
        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 with PooledObject usage in user code.
        Specified by:
        printStackTrace in interface CallStack
        writer - a PrintWriter to write the current stack trace to if available
        true if a stack trace was available to print or false if nothing was printed