Class ReflectionProfilingUtil


  • public final class ReflectionProfilingUtil
    extends java.lang.Object
    Static methods for reflection handling inside profiling.
    • Field Detail

      • CALLING_METHOD_STACK_INDEX

        public static int CALLING_METHOD_STACK_INDEX
        Index 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 Detail

      • ReflectionProfilingUtil

        public ReflectionProfilingUtil()
    • 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.
      • 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.