Class MinimalHttpAsyncClient
- java.lang.Object
-
- org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient
-
- org.apache.hc.client5.http.impl.async.AbstractHttpAsyncClientBase
-
- org.apache.hc.client5.http.impl.async.AbstractMinimalHttpAsyncClientBase
-
- org.apache.hc.client5.http.impl.async.MinimalHttpAsyncClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,HttpAsyncClient
,org.apache.hc.core5.io.ModalCloseable
@Contract(threading=SAFE_CONDITIONAL) public final class MinimalHttpAsyncClient extends AbstractMinimalHttpAsyncClientBase
Minimal implementation ofCloseableHttpAsyncClient
. This client is optimized for HTTP/1.1 and HTTP/2 message transport and does not support advanced HTTP protocol functionality such as request execution via a proxy, state management, authentication and request redirects.Concurrent message exchanges executed by this client will get assigned to separate connections leased from the connection pool.
- Since:
- 5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
MinimalHttpAsyncClient.InternalAsyncClientEndpoint
-
Nested classes/interfaces inherited from class org.apache.hc.client5.http.impl.async.AbstractHttpAsyncClientBase
AbstractHttpAsyncClientBase.Status
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOG
private AsyncClientConnectionManager
manager
private SchemePortResolver
schemePortResolver
private TlsConfig
tlsConfig
-
Constructor Summary
Constructors Constructor Description MinimalHttpAsyncClient(org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory, AsyncPushConsumerRegistry pushConsumerRegistry, org.apache.hc.core5.reactor.IOReactorConfig reactorConfig, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.ThreadFactory workerThreadFactory, AsyncClientConnectionManager manager, SchemePortResolver schemePortResolver, TlsConfig tlsConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.http.protocol.HttpContext context)
java.util.concurrent.Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint>
lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)
java.util.concurrent.Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint>
lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)
private java.util.concurrent.Future<AsyncConnectionEndpoint>
leaseEndpoint(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.util.Timeout connectionRequestTimeout, org.apache.hc.core5.util.Timeout connectTimeout, HttpClientContext clientContext, org.apache.hc.core5.concurrent.FutureCallback<AsyncConnectionEndpoint> callback)
-
Methods inherited from class org.apache.hc.client5.http.impl.async.AbstractMinimalHttpAsyncClientBase
doExecute, execute
-
Methods inherited from class org.apache.hc.client5.http.impl.async.AbstractHttpAsyncClientBase
awaitShutdown, close, close, getConnectionInitiator, getStatus, initiateShutdown, internalClose, isRunning, register, start
-
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
manager
private final AsyncClientConnectionManager manager
-
schemePortResolver
private final SchemePortResolver schemePortResolver
-
tlsConfig
private final TlsConfig tlsConfig
-
-
Constructor Detail
-
MinimalHttpAsyncClient
MinimalHttpAsyncClient(org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory, AsyncPushConsumerRegistry pushConsumerRegistry, org.apache.hc.core5.reactor.IOReactorConfig reactorConfig, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.ThreadFactory workerThreadFactory, AsyncClientConnectionManager manager, SchemePortResolver schemePortResolver, TlsConfig tlsConfig)
-
-
Method Detail
-
leaseEndpoint
private java.util.concurrent.Future<AsyncConnectionEndpoint> leaseEndpoint(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.util.Timeout connectionRequestTimeout, org.apache.hc.core5.util.Timeout connectTimeout, HttpClientContext clientContext, org.apache.hc.core5.concurrent.FutureCallback<AsyncConnectionEndpoint> callback)
-
lease
public java.util.concurrent.Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint> lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)
-
lease
public java.util.concurrent.Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint> lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)
-
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.http.protocol.HttpContext context)
- Specified by:
execute
in classAbstractMinimalHttpAsyncClientBase
-
-