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
ConstructorsConstructorDescriptionH2MultiplexingRequester(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) UseH2MultiplexingRequesterBootstrapto create instances of this class. -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseIdle(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) voidEvict expired (closed) connections.org.apache.hc.core5.concurrent.Cancellableexecute(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.Cancellableexecute(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.Cancellableexecute(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.Cancellableexecute(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.TimeValuevoidsetValidateAfterInactivity(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
-
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) UseH2MultiplexingRequesterBootstrapto create instances of this class.
-
-
Method Details
-
closeIdle
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 withevictExpired().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
-
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'sgetmethod.- 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'sgetmethod.- 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
-
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:
connectin interfaceorg.apache.hc.core5.reactor.ConnectionInitiator
-