Class H2MultiplexingRequester
java.lang.Object
org.apache.hc.core5.http.impl.bootstrap.AbstractConnectionInitiatorBase
org.apache.hc.core5.http.impl.bootstrap.AsyncRequester
org.apache.hc.core5.http2.impl.nio.bootstrap.H2MultiplexingRequester
- All Implemented Interfaces:
Closeable, AutoCloseable, ModalCloseable, ConnectionInitiator, IOReactor, IOReactorService
HTTP/2 multiplexing client side message exchange initiator.
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final H2ConnPoolprivate final intHard cap on per-connection queued / in-flight commands.private final AtomicReference<TimeValue> -
Constructor Summary
ConstructorsConstructorDescriptionH2MultiplexingRequester(IOReactorConfig ioReactorConfig, IOEventHandlerFactory eventHandlerFactory, Decorator<IOSession> ioSessionDecorator, Callback<Exception> exceptionCallback, IOSessionListener sessionListener, Resolver<HttpHost, InetSocketAddress> addressResolver, TlsStrategy tlsStrategy, IOReactorMetricsListener threadPoolListener, IOWorkerSelector workerSelector, AtomicReference<TimeValue> validateAfterInactivityRef, int maxCommandsPerConnection) UseH2MultiplexingRequesterBootstrapto create instances of this class. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.This method has no effect as of version 5.5 and should not be used.voidEvict expired (closed) connections.private voidexecute(HttpHost target, AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, CancellableDependency cancellableDependency, Timeout timeout, HttpContext context) execute(HttpHost target, AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context) execute(HttpHost target, AsyncClientExchangeHandler exchangeHandler, Timeout timeout, HttpContext context) final <T> Future<T> execute(HttpHost target, AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context, FutureCallback<T> callback) final <T> Future<T> execute(HttpHost target, AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, HttpContext context, FutureCallback<T> callback) execute(AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context) execute(AsyncClientExchangeHandler exchangeHandler, Timeout timeout, HttpContext context) final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context, FutureCallback<T> callback) final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, FutureCallback<T> callback) final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, HttpContext context, FutureCallback<T> callback) voidsetValidateAfterInactivity(TimeValue timeValue) Methods inherited from class AsyncRequester
awaitShutdown, close, close, defaultTarget, getStatus, initiateShutdown, requestSession, startMethods inherited from class AbstractConnectionInitiatorBase
connect
-
Field Details
-
connPool
-
validateAfterInactivityRef
-
maxCommandsPerConnection
private final int maxCommandsPerConnectionHard cap on per-connection queued / in-flight commands.<= 0disables the cap.
-
-
Constructor Details
-
H2MultiplexingRequester
@Internal public H2MultiplexingRequester(IOReactorConfig ioReactorConfig, IOEventHandlerFactory eventHandlerFactory, Decorator<IOSession> ioSessionDecorator, Callback<Exception> exceptionCallback, IOSessionListener sessionListener, Resolver<HttpHost, InetSocketAddress> addressResolver, TlsStrategy tlsStrategy, IOReactorMetricsListener threadPoolListener, IOWorkerSelector workerSelector, AtomicReference<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
-
setValidateAfterInactivity
-
execute
public Cancellable execute(HttpHost target, AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context) - Since:
- 5.3
-
execute
public Cancellable execute(AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context) -
execute
public Cancellable execute(HttpHost target, AsyncClientExchangeHandler exchangeHandler, Timeout timeout, HttpContext context) - Since:
- 5.3
-
execute
public Cancellable execute(AsyncClientExchangeHandler exchangeHandler, Timeout timeout, HttpContext context) -
execute
private void execute(HttpHost target, AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, CancellableDependency cancellableDependency, Timeout timeout, HttpContext context) -
execute
public final <T> Future<T> execute(HttpHost target, AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context, FutureCallback<T> callback) - Type Parameters:
T- The result type returned by the Future'sgetmethod.- Since:
- 5.3
-
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context, FutureCallback<T> callback) -
execute
public final <T> Future<T> execute(HttpHost target, AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, HttpContext context, FutureCallback<T> callback) - Type Parameters:
T- The result type returned by the Future'sgetmethod.- Since:
- 5.3
-
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, HttpContext context, FutureCallback<T> callback) -
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, FutureCallback<T> callback) -
getConnPool
-