Class InternalHttpAsyncClient
java.lang.Object
org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient
org.apache.hc.client5.http.impl.async.InternalHttpAsyncClient
- All Implemented Interfaces:
Closeable, AutoCloseable, HttpAsyncClient, org.apache.hc.core5.io.ModalCloseable, org.apache.hc.core5.reactor.ConnectionInitiator
@Contract(threading=SAFE_CONDITIONAL)
@Internal
public final class InternalHttpAsyncClient
extends CloseableHttpAsyncClient
Internal implementation of
CloseableHttpAsyncClient that can negotiate
the most optimal HTTP protocol version during during the TLS handshake
with ALPN extension if supported by the Java runtime.
Concurrent message exchanges executed by this client will get assigned to separate connections leased from the connection pool.
- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescriptionfinal voidawaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) voidclose()final voidclose(org.apache.hc.core5.io.CloseMode closeMode) Future<org.apache.hc.core5.reactor.IOSession> connect(org.apache.hc.core5.net.NamedEndpoint remoteEndpoint, SocketAddress remoteAddress, SocketAddress localAddress, org.apache.hc.core5.util.Timeout timeout, Object attachment, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> callback) protected <T> 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) final org.apache.hc.core5.reactor.IOReactorStatusfinal voidvoidregister(String hostname, String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier) Deprecated.final voidstart()
-
Method Details
-
doExecute
protected <T> 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:
doExecutein classCloseableHttpAsyncClient
-
start
public final void start()- Specified by:
startin classCloseableHttpAsyncClient
-
register
@Deprecated public void register(String hostname, String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier) Deprecated.UseRequestRouterat the construction time- Specified by:
registerin classCloseableHttpAsyncClient
-
connect
public Future<org.apache.hc.core5.reactor.IOSession> connect(org.apache.hc.core5.net.NamedEndpoint remoteEndpoint, SocketAddress remoteAddress, SocketAddress localAddress, org.apache.hc.core5.util.Timeout timeout, Object attachment, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.IOSession> callback) - Specified by:
connectin interfaceorg.apache.hc.core5.reactor.ConnectionInitiator
-
getStatus
public final org.apache.hc.core5.reactor.IOReactorStatus getStatus()- Specified by:
getStatusin classCloseableHttpAsyncClient
-
awaitShutdown
public final void awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) throws InterruptedException - Specified by:
awaitShutdownin classCloseableHttpAsyncClient- Throws:
InterruptedException
-
initiateShutdown
public final void initiateShutdown()- Specified by:
initiateShutdownin classCloseableHttpAsyncClient
-
close
public final void close(org.apache.hc.core5.io.CloseMode closeMode) - Specified by:
closein interfaceorg.apache.hc.core5.io.ModalCloseable
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
RequestRouterat the construction time