Class ClientInvocationHandler<T>

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

    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.
    Author:
    Jerome Louvel
    • Constructor Summary

      Constructors 
      Constructor Description
      ClientInvocationHandler​(org.restlet.resource.ClientResource clientResource, java.lang.Class<? extends T> resourceInterface)
      Constructor.
      ClientInvocationHandler​(org.restlet.resource.ClientResource clientResource, java.lang.Class<? extends T> resourceInterface, AnnotationUtils annotationUtils)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<AnnotationInfo> getAnnotations()
      Returns the annotations of the resource interface.
      AnnotationUtils getAnnotationUtils()
      Returns the associated annotation utils.
      org.restlet.resource.ClientResource getClientResource()
      Returns the associated client resource.
      protected org.restlet.Request getRequest​(java.lang.reflect.Method javaMethod, java.lang.Object[] args)
      Allows for child classes to modify the request.
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method javaMethod, java.lang.Object[] args)
      Effectively invokes a Java method on the given proxy object.
      • Methods inherited from class java.lang.Object

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

      • ClientInvocationHandler

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

        public ClientInvocationHandler​(org.restlet.resource.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 org.restlet.resource.ClientResource getClientResource()
        Returns the associated client resource.
        Returns:
        The associated client resource.
      • getRequest

        protected org.restlet.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