Class ClassicToAsyncAdaptor

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, HttpClient, org.apache.hc.core5.io.ModalCloseable

    @Experimental
    @Internal
    @Contract(threading=SAFE_CONDITIONAL)
    public class ClassicToAsyncAdaptor
    extends CloseableHttpClient
    CloseableHttpClient implementation backed by CloseableHttpAsyncClient acting as a compatibility bridge with the classic APIs based on the standard InputStream / OutputStream model.
    Since:
    5.5
    • Field Detail

      • operationTimeout

        private final org.apache.hc.core5.util.Timeout operationTimeout
    • Constructor Detail

      • ClassicToAsyncAdaptor

        public ClassicToAsyncAdaptor​(CloseableHttpAsyncClient client,
                                     org.apache.hc.core5.util.Timeout operationTimeout)
    • Method Detail

      • doExecute

        protected CloseableHttpResponse doExecute​(org.apache.hc.core5.http.HttpHost target,
                                                  org.apache.hc.core5.http.ClassicHttpRequest request,
                                                  org.apache.hc.core5.http.protocol.HttpContext context)
                                           throws java.io.IOException
        Specified by:
        doExecute in class CloseableHttpClient
        Throws:
        java.io.IOException
      • close

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

        public void close​(org.apache.hc.core5.io.CloseMode closeMode)