Class Interceptor


  • public class Interceptor
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object intercept​(java.lang.Object self, java.lang.reflect.Method method, java.lang.Object[] args, java.util.concurrent.Callable<?> callable)
      A magic method used to wrap public method calls in classes patched by ByteBuddy and acting as proxies.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • intercept

        @RuntimeType
        public static java.lang.Object intercept​(@This
                                                 java.lang.Object self,
                                                 @Origin
                                                 java.lang.reflect.Method method,
                                                 @AllArguments
                                                 java.lang.Object[] args,
                                                 @SuperCall
                                                 java.util.concurrent.Callable<?> callable)
                                          throws java.lang.Throwable
        A magic method used to wrap public method calls in classes patched by ByteBuddy and acting as proxies. The performance of this method is mission-critical as it gets called upon every invocation of any method of the proxied class.
        Parameters:
        self - The reference to the original instance.
        method - The reference to the original method.
        args - The reference to method args.
        callable - The reference to the non-patched callable to avoid call recursion.
        Returns:
        Either the original method result or the patched one.
        Throws:
        java.lang.Throwable