Package com.bw.jtools.profiling
Class ReflectionProfilingUtil
- java.lang.Object
-
- com.bw.jtools.profiling.ReflectionProfilingUtil
-
public final class ReflectionProfilingUtil extends java.lang.ObjectStatic methods for reflection handling inside profiling.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReflectionProfilingUtil.StackAccessMode
-
Field Summary
Fields Modifier and Type Field Description static intCALLING_METHOD_STACK_INDEXIndex of the calling method of a method that calls getStackTraceElement.
This value may diff for other JVMs and possibly needs adaption during run-time.
-
Constructor Summary
Constructors Constructor Description ReflectionProfilingUtil()
-
Method Summary
Modifier and Type Method Description static ReflectionProfilingUtil.StackAccessModegetStackTraceAccessMode()The current stack-trace-access mode.static java.lang.StackTraceElementgetStackTraceElement(int level)Gets a stack-trace-element with minimal overhead.static java.lang.StringnormalizeClassName(java.lang.String className)Normalize a class name according to settings.static voidsetStackTraceAccessMode(ReflectionProfilingUtil.StackAccessMode mode)Sets a new stack-trace-access mode, used to retrieve caller-methods.
-
-
-
Method Detail
-
setStackTraceAccessMode
public static void setStackTraceAccessMode(ReflectionProfilingUtil.StackAccessMode mode)
Sets a new stack-trace-access mode, used to retrieve caller-methods.- Parameters:
mode- The mode to set.
-
getStackTraceAccessMode
public static ReflectionProfilingUtil.StackAccessMode getStackTraceAccessMode()
The current stack-trace-access mode.- Returns:
- The current mode.
-
getStackTraceElement
public static java.lang.StackTraceElement getStackTraceElement(int level)
Gets a stack-trace-element with minimal overhead.- Parameters:
level- 1 for caller of this method and +1 for each caller above.- Returns:
- The Trace Element.
-
normalizeClassName
public static java.lang.String normalizeClassName(java.lang.String className)
Normalize a class name according to settings.- Parameters:
className- The name of the class.- Returns:
- The normalized class name.
-
-