Class ClientInvocationHandler<T>

  • Type Parameters:
    T - The annotated resource interface.
    All Implemented Interfaces:
    java.lang.reflect.InvocationHandler
    Direct Known Subclasses:
    JaxRsClientInvocationHandler

    public class ClientInvocationHandler<T>
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    Reflection proxy invocation handler created for the ClientResource.wrap(Class) and related methods.
    • Field Detail

      • annotations

        private final java.util.List<AnnotationInfo> annotations
        The annotations of the resource interface.
      • annotationUtils

        private AnnotationUtils annotationUtils
        The associated annotation utils.
      • clientResource

        private final ClientResource clientResource
        The associated client resource.
    • Constructor Detail

      • ClientInvocationHandler

        public ClientInvocationHandler​(ClientResource clientResource,
                                       java.lang.Class<? extends T> resourceInterface)
        Constructor.
        Parameters:
        clientResource - The associated client resource.
        resourceInterface - The annotated resource interface.
      • ClientInvocationHandler

        public ClientInvocationHandler​(ClientResource clientResource,
                                       java.lang.Class<? extends T> resourceInterface,
                                       AnnotationUtils annotationUtils)
        Constructor.
        Parameters:
        clientResource - The associated client resource.
        resourceInterface - The annotated resource interface.
        annotationUtils - The annotationUtils class.
    • Method Detail

      • getAnnotations

        public java.util.List<AnnotationInfo> getAnnotations()
        Returns the annotations of the resource interface.
        Returns:
        The annotations of the resource interface.
      • getAnnotationUtils

        public AnnotationUtils getAnnotationUtils()
        Returns the associated annotation utils.
        Returns:
        The associated annotation utils.
      • getClientResource

        public ClientResource getClientResource()
        Returns the associated client resource.
        Returns:
        The associated client resource.
      • getRequest

        protected Request getRequest​(java.lang.reflect.Method javaMethod,
                                     java.lang.Object[] args)
                              throws java.lang.Throwable
        Allows for child classes to modify the request.
        Throws:
        java.lang.Throwable
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method javaMethod,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Effectively invokes a Java method on the given proxy object.
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable