Class H2MultiplexingRequester

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

    public class H2MultiplexingRequester
    extends org.apache.hc.core5.http.impl.bootstrap.AsyncRequester
    HTTP/2 multiplexing client side message exchange initiator.
    Since:
    5.0
    • Constructor Summary

      Constructors 
      Constructor Description
      H2MultiplexingRequester​(org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory, org.apache.hc.core5.function.Decorator<org.apache.hc.core5.reactor.IOSession> ioSessionDecorator, org.apache.hc.core5.function.Callback<java.lang.Exception> exceptionCallback, org.apache.hc.core5.reactor.IOSessionListener sessionListener, org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpHost,​java.net.InetSocketAddress> addressResolver, org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy, org.apache.hc.core5.reactor.IOReactorMetricsListener threadPoolListener, org.apache.hc.core5.reactor.IOWorkerSelector workerSelector, java.util.concurrent.atomic.AtomicReference<org.apache.hc.core5.util.TimeValue> validateAfterInactivityRef, int maxCommandsPerConnection)
      Use H2MultiplexingRequesterBootstrap to create instances of this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void closeIdle​(org.apache.hc.core5.util.TimeValue idleTime)
      Deprecated.
      This method has no effect as of version 5.5 and should not be used.
      java.util.concurrent.Future<org.apache.hc.core5.reactor.IOSession> connect​(org.apache.hc.core5.net.NamedEndpoint arg0, java.net.SocketAddress arg1, java.net.SocketAddress arg2, org.apache.hc.core5.util.Timeout arg3, java.lang.Object arg4, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> arg5)  
      void evictExpired()
      Evict expired (closed) connections.
      org.apache.hc.core5.concurrent.Cancellable execute​(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.util.Timeout timeout, org.apache.hc.core5.http.protocol.HttpContext context)  
      org.apache.hc.core5.concurrent.Cancellable execute​(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler, org.apache.hc.core5.util.Timeout timeout, org.apache.hc.core5.http.protocol.HttpContext context)  
      <T> java.util.concurrent.Future<T> execute​(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.util.Timeout timeout, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)  
      <T> java.util.concurrent.Future<T> execute​(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.util.Timeout timeout, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)  
      org.apache.hc.core5.concurrent.Cancellable execute​(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler, org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, org.apache.hc.core5.util.Timeout timeout, org.apache.hc.core5.http.protocol.HttpContext context)  
      org.apache.hc.core5.concurrent.Cancellable execute​(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler, org.apache.hc.core5.util.Timeout timeout, org.apache.hc.core5.http.protocol.HttpContext context)  
      <T> java.util.concurrent.Future<T> execute​(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.util.Timeout timeout, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)  
      <T> java.util.concurrent.Future<T> execute​(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.util.Timeout timeout, org.apache.hc.core5.concurrent.FutureCallback<T> callback)  
      <T> java.util.concurrent.Future<T> execute​(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.util.Timeout timeout, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)  
      H2ConnPool getConnPool()  
      java.util.Set<org.apache.hc.core5.http.HttpHost> getRoutes()  
      org.apache.hc.core5.util.TimeValue getValidateAfterInactivity()  
      void setValidateAfterInactivity​(org.apache.hc.core5.util.TimeValue timeValue)  
      • Methods inherited from class org.apache.hc.core5.http.impl.bootstrap.AsyncRequester

        awaitShutdown, close, close, defaultTarget, getStatus, initiateShutdown, requestSession, start
      • Methods inherited from class java.lang.Object

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

      • H2MultiplexingRequester

        @Internal
        public H2MultiplexingRequester​(org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig,
                                       org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory,
                                       org.apache.hc.core5.function.Decorator<org.apache.hc.core5.reactor.IOSession> ioSessionDecorator,
                                       org.apache.hc.core5.function.Callback<java.lang.Exception> exceptionCallback,
                                       org.apache.hc.core5.reactor.IOSessionListener sessionListener,
                                       org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpHost,​java.net.InetSocketAddress> addressResolver,
                                       org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy,
                                       org.apache.hc.core5.reactor.IOReactorMetricsListener threadPoolListener,
                                       org.apache.hc.core5.reactor.IOWorkerSelector workerSelector,
                                       java.util.concurrent.atomic.AtomicReference<org.apache.hc.core5.util.TimeValue> validateAfterInactivityRef,
                                       int maxCommandsPerConnection)
        Use H2MultiplexingRequesterBootstrap to create instances of this class.
    • Method Detail

      • closeIdle

        @Deprecated
        public void closeIdle​(org.apache.hc.core5.util.TimeValue idleTime)
        Deprecated.
        This method has no effect as of version 5.5 and should not be used. Use the connection level socket timeout to ensure idle connections time out and get gracefully terminated. Expired connections can be proactively evicted from the pool with evictExpired().
        This method has no effect. Its initial implementation has been removed, as it can cause termination of sessions with multiplexing message exchange such as HTTP/2.
        See Also:
        evictExpired()
      • evictExpired

        public void evictExpired()
        Evict expired (closed) connections.
        Since:
        5.5
      • getRoutes

        public java.util.Set<org.apache.hc.core5.http.HttpHost> getRoutes()
      • getValidateAfterInactivity

        public org.apache.hc.core5.util.TimeValue getValidateAfterInactivity()
      • setValidateAfterInactivity

        public void setValidateAfterInactivity​(org.apache.hc.core5.util.TimeValue timeValue)
      • execute

        public org.apache.hc.core5.concurrent.Cancellable execute​(org.apache.hc.core5.http.HttpHost target,
                                                                  org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler,
                                                                  org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
                                                                  org.apache.hc.core5.util.Timeout timeout,
                                                                  org.apache.hc.core5.http.protocol.HttpContext context)
        Since:
        5.3
      • execute

        public org.apache.hc.core5.concurrent.Cancellable execute​(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler,
                                                                  org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
                                                                  org.apache.hc.core5.util.Timeout timeout,
                                                                  org.apache.hc.core5.http.protocol.HttpContext context)
      • execute

        public org.apache.hc.core5.concurrent.Cancellable execute​(org.apache.hc.core5.http.HttpHost target,
                                                                  org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler,
                                                                  org.apache.hc.core5.util.Timeout timeout,
                                                                  org.apache.hc.core5.http.protocol.HttpContext context)
        Since:
        5.3
      • execute

        public org.apache.hc.core5.concurrent.Cancellable execute​(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler,
                                                                  org.apache.hc.core5.util.Timeout timeout,
                                                                  org.apache.hc.core5.http.protocol.HttpContext context)
      • execute

        public final <T> java.util.concurrent.Future<T> execute​(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.util.Timeout timeout,
                                                                org.apache.hc.core5.http.protocol.HttpContext context,
                                                                org.apache.hc.core5.concurrent.FutureCallback<T> callback)
        Type Parameters:
        T - The result type returned by the Future's get method.
        Since:
        5.3
      • execute

        public final <T> java.util.concurrent.Future<T> execute​(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.util.Timeout timeout,
                                                                org.apache.hc.core5.http.protocol.HttpContext context,
                                                                org.apache.hc.core5.concurrent.FutureCallback<T> callback)
      • execute

        public final <T> java.util.concurrent.Future<T> execute​(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.util.Timeout timeout,
                                                                org.apache.hc.core5.http.protocol.HttpContext context,
                                                                org.apache.hc.core5.concurrent.FutureCallback<T> callback)
        Type Parameters:
        T - The result type returned by the Future's get method.
        Since:
        5.3
      • execute

        public final <T> java.util.concurrent.Future<T> execute​(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
                                                                org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
                                                                org.apache.hc.core5.util.Timeout timeout,
                                                                org.apache.hc.core5.http.protocol.HttpContext context,
                                                                org.apache.hc.core5.concurrent.FutureCallback<T> callback)
      • execute

        public final <T> java.util.concurrent.Future<T> execute​(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
                                                                org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
                                                                org.apache.hc.core5.util.Timeout timeout,
                                                                org.apache.hc.core5.concurrent.FutureCallback<T> callback)
      • getConnPool

        @Internal
        public H2ConnPool getConnPool()
      • connect

        public final java.util.concurrent.Future<org.apache.hc.core5.reactor.IOSession> connect​(org.apache.hc.core5.net.NamedEndpoint arg0,
                                                                                                java.net.SocketAddress arg1,
                                                                                                java.net.SocketAddress arg2,
                                                                                                org.apache.hc.core5.util.Timeout arg3,
                                                                                                java.lang.Object arg4,
                                                                                                org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> arg5)
        Specified by:
        connect in interface org.apache.hc.core5.reactor.ConnectionInitiator