Class CallTrace
- java.lang.Object
-
- com.igormaznitsa.meta.common.utils.CallTrace
-
- All Implemented Interfaces:
java.io.Serializable
@Weight(VARIABLE) public class CallTrace extends java.lang.Object implements java.io.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
eol
static java.lang.String
EOL_LINUX
Default end-of-line for linux.static java.lang.String
EOL_WINDOWS
Default end-of-line for windows.private boolean
packed
private static long
serialVersionUID
private byte[]
stacktrace
private java.lang.String
threadDescriptor
private static java.nio.charset.Charset
UTF8
-
Constructor Summary
Constructors Constructor Description CallTrace()
The Constructor allows to create call trace history point for the called method.CallTrace(boolean skipConstructors, boolean pack, java.lang.String eol)
The Constructor allows to create call trace history with defined end-of-line symbol and since needed stack item position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getThreadDescriptor()
Get the descriptor of the thread where the object instance was created.java.lang.String
restoreStackTrace()
Restore stack trace as a string from inside data representation.java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
UTF8
private static final java.nio.charset.Charset UTF8
-
EOL_LINUX
public static final java.lang.String EOL_LINUX
Default end-of-line for linux.- Since:
- 1.0
- See Also:
- Constant Field Values
-
EOL_WINDOWS
public static final java.lang.String EOL_WINDOWS
Default end-of-line for windows.- Since:
- 1.0
- See Also:
- Constant Field Values
-
packed
private final boolean packed
-
stacktrace
private final byte[] stacktrace
-
threadDescriptor
private final java.lang.String threadDescriptor
-
eol
private final java.lang.String eol
-
-
Constructor Detail
-
CallTrace
public CallTrace()
The Constructor allows to create call trace history point for the called method.- Since:
- 1.0
- See Also:
EOL_LINUX
-
CallTrace
@Weight(value=VARIABLE, comment="Depends on the call stack depth") public CallTrace(boolean skipConstructors, boolean pack, java.lang.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 packedeol
- string shows which end-of-line should be used- Since:
- 1.0.2
- See Also:
EOL_LINUX
,EOL_WINDOWS
-
-
Method Detail
-
getThreadDescriptor
public java.lang.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:
Thread.toString()
-
restoreStackTrace
public java.lang.String restoreStackTrace()
Restore stack trace as a string from inside data representation.- Returns:
- the stack trace as String
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-