Class DefaultMethodHandler

  • All Implemented Interfaces:
    feign.InvocationHandlerFactory.MethodHandler, MethodHandler

    public final class DefaultMethodHandler
    extends java.lang.Object
    implements MethodHandler
    Handles default methods by directly invoking the default method code on the interface. The bindTo method must be called on the result before invoke is called.
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultMethodHandler​(java.lang.reflect.Method defaultMethod)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bindTo​(java.lang.Object proxy)
      Bind this handler to a proxy object.
      java.lang.Object invoke​(java.lang.Object[] argv)
      Invoke this method.
      • Methods inherited from class java.lang.Object

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

      • DefaultMethodHandler

        public DefaultMethodHandler​(java.lang.reflect.Method defaultMethod)
    • Method Detail

      • bindTo

        public void bindTo​(java.lang.Object proxy)
        Bind this handler to a proxy object. After bound, DefaultMethodHandler#invoke will act as if it was called on the proxy object. Must be called once and only once for a given instance of DefaultMethodHandler
      • invoke

        public java.lang.Object invoke​(java.lang.Object[] argv)
                                throws java.lang.Throwable
        Invoke this method. DefaultMethodHandler#bindTo must be called before the first time invoke is called.
        Specified by:
        invoke in interface feign.InvocationHandlerFactory.MethodHandler
        Throws:
        java.lang.Throwable