Class InternalH2AsyncClient

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

    @Contract(threading=SAFE_CONDITIONAL)
    @Internal
    public final class InternalH2AsyncClient
    extends CloseableHttpAsyncClient
    Internal implementation of HTTP/2 only CloseableHttpAsyncClient.

    Concurrent message exchanges with the same connection route executed by this client will get automatically multiplexed over a single physical HTTP/2 connection.

    Since:
    5.0
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void awaitShutdown​(org.apache.hc.core5.util.TimeValue waitTime)  
      void close()  
      void close​(org.apache.hc.core5.io.CloseMode closeMode)  
      java.util.concurrent.Future<org.apache.hc.core5.reactor.IOSession> connect​(org.apache.hc.core5.net.NamedEndpoint remoteEndpoint, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, org.apache.hc.core5.util.Timeout timeout, java.lang.Object attachment, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> callback)  
      protected <T> java.util.concurrent.Future<T> doExecute​(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)  
      org.apache.hc.core5.reactor.IOReactorStatus getStatus()  
      void initiateShutdown()  
      void register​(java.lang.String hostname, java.lang.String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)
      Deprecated.
      Use RequestRouter at the construction time
      void start()  
      • Methods inherited from class java.lang.Object

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

      • doExecute

        protected <T> java.util.concurrent.Future<T> doExecute​(org.apache.hc.core5.http.HttpHost target,
                                                               org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
                                                               org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
                                                               org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
                                                               org.apache.hc.core5.http.protocol.HttpContext context,
                                                               org.apache.hc.core5.concurrent.FutureCallback<T> callback)
        Specified by:
        doExecute in class CloseableHttpAsyncClient
      • register

        @Deprecated
        public void register​(java.lang.String hostname,
                             java.lang.String uriPattern,
                             org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)
        Deprecated.
        Use RequestRouter at the construction time
        Specified by:
        register in class CloseableHttpAsyncClient
      • connect

        public java.util.concurrent.Future<org.apache.hc.core5.reactor.IOSession> connect​(org.apache.hc.core5.net.NamedEndpoint remoteEndpoint,
                                                                                          java.net.SocketAddress remoteAddress,
                                                                                          java.net.SocketAddress localAddress,
                                                                                          org.apache.hc.core5.util.Timeout timeout,
                                                                                          java.lang.Object attachment,
                                                                                          org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> callback)
        Specified by:
        connect in interface org.apache.hc.core5.reactor.ConnectionInitiator
      • awaitShutdown

        public final void awaitShutdown​(org.apache.hc.core5.util.TimeValue waitTime)
                                 throws java.lang.InterruptedException
        Specified by:
        awaitShutdown in class CloseableHttpAsyncClient
        Throws:
        java.lang.InterruptedException
      • close

        public final void close​(org.apache.hc.core5.io.CloseMode closeMode)
        Specified by:
        close in interface org.apache.hc.core5.io.ModalCloseable
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable