Class SecurityManagerCallStack

  • All Implemented Interfaces:
    CallStack

    public class SecurityManagerCallStack
    extends java.lang.Object
    implements CallStack
    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:
    RuntimePermission, SecurityManager.getClassContext()
    • Constructor Detail

      • SecurityManagerCallStack

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

      • printStackTrace

        public boolean printStackTrace​(java.io.PrintWriter 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
        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