Class ByteBuddyProxyStrategy.Interceptor

  • Enclosing class:
    ByteBuddyProxyStrategy

    public static class ByteBuddyProxyStrategy.Interceptor
    extends java.lang.Object
    Interceptor class to call the underlying delegate object when the proxy is accessed.

    This class is public in order for the proxy to be able to call it from the package it was created in.

    • Constructor Summary

      Constructors 
      Constructor Description
      Interceptor()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object intercept​(java.lang.reflect.Method method, java.lang.Object[] args, ProxyStrategy.InstanceSupplier<?> instanceSupplier)
      Intercepts a proxied method.
      • Methods inherited from class java.lang.Object

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

      • Interceptor

        public Interceptor()
    • Method Detail

      • intercept

        @RuntimeType
        public static java.lang.Object intercept​(@Origin
                                                 java.lang.reflect.Method method,
                                                 @AllArguments
                                                 java.lang.Object[] args,
                                                 @FieldValue("__instanceSupplier__")
                                                 ProxyStrategy.InstanceSupplier<?> instanceSupplier)
                                          throws java.lang.Throwable
        Intercepts a proxied method.
        Parameters:
        method - the proxied Method, cannot be null
        args - the arguments with which the method was called, cannot be null
        instanceSupplier - an ProxyStrategy.InstanceSupplier to supply the underlying object which was proxied, cannot be null
        Returns:
        the result of the proxied method, can be null
        Throws:
        java.lang.Throwable - when the proxied method threw an exception