Class Reflect

java.lang.Object
org.apache.pekko.util.Reflect

public class Reflect extends Object
Collection of internal reflection utilities which may or may not be available (most services specific to HotSpot, but fails gracefully).

INTERNAL API

  • Constructor Details

    • Reflect

      public Reflect()
  • Method Details

    • getCallerClass

      public static scala.Option<scala.Function1<Object,Class<?>>> getCallerClass()
      This optionally holds a function which looks N levels above itself on the call stack and returns the Class[_] object for the code executing in that stack frame. Implemented using sun.reflect.Reflection.getCallerClass if available, None otherwise.

      Hint: when comparing to Thread.currentThread().getStackTrace, add two levels.

    • findMarker

      public static Type findMarker(Class<?> root, Class<?> marker)