Class QuarkusProxyInvocationHandler

java.lang.Object
io.quarkus.restclient.runtime.QuarkusProxyInvocationHandler
All Implemented Interfaces:
InvocationHandler

public class QuarkusProxyInvocationHandler extends Object implements InvocationHandler
Quarkus version of ProxyInvocationHandler retaining the ability to create a custom interceptor chain and invoke it manually.

This is needed due to changes in https://github.com/resteasy/resteasy-microprofile/pull/182

In theory, it could be improved by pre-generating proxies for @RegisterRestClient interfaces and registering them as standard beans with all their interceptor bindings.

  • Field Details

    • NO_TYPES

      public static final Type[] NO_TYPES
  • Constructor Details

    • QuarkusProxyInvocationHandler

      public QuarkusProxyInvocationHandler(Class<?> restClientInterface, Object target, Set<Object> providerInstances, org.jboss.resteasy.client.jaxrs.ResteasyClient client, jakarta.enterprise.inject.spi.BeanManager beanManager)
  • Method Details

    • invoke

      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
      Specified by:
      invoke in interface InvocationHandler
      Throws:
      Throwable
    • createProxy

      static Object createProxy(Class<?> resourceInterface, Object target, boolean addExtendedInterfaces, Set<Object> providers, org.jboss.resteasy.client.jaxrs.ResteasyClient client)
      Creates a proxy for the interface.

      If addExtendedInterfaces is set to true, the proxy will implement the interfaces RestClientProxy and Closeable.

      Parameters:
      resourceInterface - the resource interface to create the proxy for
      target - the target object for the proxy
      addExtendedInterfaces - true if the proxy should also implement RestClientProxy and Closeable
      providers - the providers for the client
      client - the client to use
      Returns:
      the new proxy