Interface Instrumented


public interface Instrumented
Marker interface for instrumented type.
  • Method Details

    • allocateInstance

      static <T> T allocateInstance(Class<T> type)
      Instantiate a class without running constructors.
      Type Parameters:
      T - type
      Parameters:
      type - type
      Returns:
      instance
    • isInstrumented

      static boolean isInstrumented(Class<?> type)
      Test if the given type is instrumented.
      Parameters:
      type - type
      Returns:
      true if instrumented, false otherwise
    • instrument

      static <T> Class<? extends T> instrument(Class<T> type, List<Annotation> annotations, List<Class<? extends Annotation>> methodExcludes, BiFunction<Class<T>,Method,T> resolver)
      Create an instrumented class.
      Type Parameters:
      T - type
      Parameters:
      type - type
      annotations - annotations to add to the proxy class
      methodExcludes - method annotations that skip interception
      resolver - function to resolve the delegate
      Returns:
      instrumented class
    • instrument

      static <T> Class<? extends T> instrument(Class<T> type, List<Annotation> annotations, List<Class<? extends Annotation>> methodExcludes, InvocationHandler handler)
      Create an instrumented class.
      Type Parameters:
      T - type
      Parameters:
      type - type
      annotations - annotations to add to the proxy class
      methodExcludes - method annotations that skip interception
      handler - invocation handler
      Returns:
      instrumented class