Class CallTrace

java.lang.Object
com.igormaznitsa.meta.common.utils.CallTrace
All Implemented Interfaces:
Serializable

@Weight(VARIABLE) public class CallTrace extends Object implements Serializable
The Class allows to save stack trace history (it is possible to keep it in packed format) and restore it to text representation for request.
Since:
1.0
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • UTF8

      private static final Charset UTF8
    • EOL_LINUX

      public static final String EOL_LINUX
      Default end-of-line for linux.
      Since:
      1.0
      See Also:
    • EOL_WINDOWS

      public static final String EOL_WINDOWS
      Default end-of-line for windows.
      Since:
      1.0
      See Also:
    • packed

      private final boolean packed
    • stacktrace

      private final byte[] stacktrace
    • threadDescriptor

      private final String threadDescriptor
    • eol

      private final String eol
  • Constructor Details

    • CallTrace

      public CallTrace()
      The Constructor allows to create call trace history point for the called method.
      Since:
      1.0
      See Also:
    • CallTrace

      @Weight(value=VARIABLE, comment="Depends on the call stack depth") public CallTrace(boolean skipConstructors, boolean pack, String eol)
      The Constructor allows to create call trace history with defined end-of-line symbol and since needed stack item position.
      Parameters:
      skipConstructors - flag to skip first calls from constructors in the stack.
      pack - flag shows that string data must be packed, false if should not be packed
      eol - string shows which end-of-line should be used
      Since:
      1.0.2
      See Also:
  • Method Details

    • getThreadDescriptor

      public String getThreadDescriptor()
      Get the descriptor of the thread where the object instance was created.
      Returns:
      the descriptor as String
      Since:
      1.0.2
      See Also:
    • restoreStackTrace

      public String restoreStackTrace()
      Restore stack trace as a string from inside data representation.
      Returns:
      the stack trace as String
    • toString

      public String toString()
      Overrides:
      toString in class Object