Class H2MultiplexingRequester

java.lang.Object
org.apache.hc.core5.http.impl.bootstrap.AsyncRequester
org.apache.hc.core5.http2.impl.nio.bootstrap.H2MultiplexingRequester
All Implemented Interfaces:
Closeable, 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<Exception> exceptionCallback, org.apache.hc.core5.reactor.IOSessionListener sessionListener, org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpHost, 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, AtomicReference<org.apache.hc.core5.util.TimeValue> validateAfterInactivityRef, int maxCommandsPerConnection)
    Use H2MultiplexingRequesterBootstrap to create instances of this class.
  • Method Summary

    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.
    final Future<org.apache.hc.core5.reactor.IOSession>
    connect(org.apache.hc.core5.net.NamedEndpoint arg0, SocketAddress arg1, SocketAddress arg2, org.apache.hc.core5.util.Timeout arg3, Object arg4, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> arg5)
     
    void
    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)
     
    final <T> 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)
     
    final <T> 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)
     
    final <T> 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)
     
    final <T> 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)
     
    final <T> 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)
     
     
    Set<org.apache.hc.core5.http.HttpHost>
     
    org.apache.hc.core5.util.TimeValue
     
    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 Object

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

    • 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<Exception> exceptionCallback, org.apache.hc.core5.reactor.IOSessionListener sessionListener, org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpHost, 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, AtomicReference<org.apache.hc.core5.util.TimeValue> validateAfterInactivityRef, int maxCommandsPerConnection)
      Use H2MultiplexingRequesterBootstrap to create instances of this class.
  • Method Details

    • 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

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

      public 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> 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> 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> 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> 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> 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 Future<org.apache.hc.core5.reactor.IOSession> connect(org.apache.hc.core5.net.NamedEndpoint arg0, SocketAddress arg1, SocketAddress arg2, org.apache.hc.core5.util.Timeout arg3, 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