Class ResponseProxyHandler

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    class ResponseProxyHandler
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    A proxy class that can enhance an arbitrary HttpResponse with Closeable.close() method.
    Since:
    4.3
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.reflect.Method CLOSE_METHOD  
      private org.apache.http.HttpResponse original  
    • Constructor Summary

      Constructors 
      Constructor Description
      ResponseProxyHandler​(org.apache.http.HttpResponse original)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)  
      • Methods inherited from class java.lang.Object

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

      • CLOSE_METHOD

        private static final java.lang.reflect.Method CLOSE_METHOD
      • original

        private final org.apache.http.HttpResponse original
    • Constructor Detail

      • ResponseProxyHandler

        ResponseProxyHandler​(org.apache.http.HttpResponse original)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable