Class InternalHttpAsyncClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
,HttpAsyncClient
,HttpPipeliningClient
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase
CloseableHttpAsyncClientBase.Status
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.http.config.Lookup
<org.apache.http.auth.AuthSchemeProvider> private final NHttpClientConnectionManager
private final org.apache.http.ConnectionReuseStrategy
private final org.apache.http.config.Lookup
<org.apache.http.cookie.CookieSpecProvider> private final org.apache.http.client.CookieStore
private final org.apache.http.client.CredentialsProvider
private final org.apache.http.client.config.RequestConfig
private final InternalClientExec
private final org.apache.http.conn.ConnectionKeepAliveStrategy
private final org.apache.commons.logging.Log
-
Constructor Summary
ConstructorsConstructorDescriptionInternalHttpAsyncClient
(NHttpClientConnectionManager connmgr, org.apache.http.ConnectionReuseStrategy connReuseStrategy, org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy, ThreadFactory threadFactory, org.apache.http.nio.NHttpClientEventHandler handler, InternalClientExec exec, org.apache.http.config.Lookup<org.apache.http.cookie.CookieSpecProvider> cookieSpecRegistry, org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> authSchemeRegistry, org.apache.http.client.CookieStore cookieStore, org.apache.http.client.CredentialsProvider credentialsProvider, org.apache.http.client.config.RequestConfig defaultConfig) -
Method Summary
Modifier and TypeMethodDescriptionexecute
(org.apache.http.HttpHost target, List<? extends org.apache.http.nio.protocol.HttpAsyncRequestProducer> requestProducers, List<? extends org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> responseConsumers, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<List<T>> callback) Initiates pipelined execution of a sequence of requests.<T> Future
<T> execute
(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<T> callback) Initiates asynchronous HTTP request execution using the given context.private void
setupContext
(org.apache.http.client.protocol.HttpClientContext context) Methods inherited from class org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase
close, ensureRunning, isRunning, start
Methods inherited from class org.apache.http.impl.nio.client.CloseableHttpPipeliningClient
execute, execute, execute
Methods inherited from class org.apache.http.impl.nio.client.CloseableHttpAsyncClient
execute, execute, execute, execute, execute
-
Field Details
-
log
private final org.apache.commons.logging.Log log -
connmgr
-
connReuseStrategy
private final org.apache.http.ConnectionReuseStrategy connReuseStrategy -
keepaliveStrategy
private final org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy -
exec
-
cookieSpecRegistry
private final org.apache.http.config.Lookup<org.apache.http.cookie.CookieSpecProvider> cookieSpecRegistry -
authSchemeRegistry
private final org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> authSchemeRegistry -
cookieStore
private final org.apache.http.client.CookieStore cookieStore -
credentialsProvider
private final org.apache.http.client.CredentialsProvider credentialsProvider -
defaultConfig
private final org.apache.http.client.config.RequestConfig defaultConfig
-
-
Constructor Details
-
InternalHttpAsyncClient
public InternalHttpAsyncClient(NHttpClientConnectionManager connmgr, org.apache.http.ConnectionReuseStrategy connReuseStrategy, org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy, ThreadFactory threadFactory, org.apache.http.nio.NHttpClientEventHandler handler, InternalClientExec exec, org.apache.http.config.Lookup<org.apache.http.cookie.CookieSpecProvider> cookieSpecRegistry, org.apache.http.config.Lookup<org.apache.http.auth.AuthSchemeProvider> authSchemeRegistry, org.apache.http.client.CookieStore cookieStore, org.apache.http.client.CredentialsProvider credentialsProvider, org.apache.http.client.config.RequestConfig defaultConfig)
-
-
Method Details
-
setupContext
private void setupContext(org.apache.http.client.protocol.HttpClientContext context) -
execute
public <T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<T> callback) Description copied from interface:HttpAsyncClient
Initiates asynchronous HTTP request execution using the given context.The request producer passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumer passed to this method will be used to process a response message without buffering its content in memory.
Please note it may be unsafe to interact with the context instance while the request is still being executed.
- Type Parameters:
T
- the result type of request execution.- Parameters:
requestProducer
- request producer callback.responseConsumer
- response consumer callaback.context
- HTTP contextcallback
- future callback.- Returns:
- future representing pending completion of the operation.
-
execute
public <T> Future<List<T>> execute(org.apache.http.HttpHost target, List<? extends org.apache.http.nio.protocol.HttpAsyncRequestProducer> requestProducers, List<? extends org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> responseConsumers, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<List<T>> callback) Description copied from interface:HttpPipeliningClient
Initiates pipelined execution of a sequence of requests.The request producers passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumers passed to this method will be used to process a response message without buffering its content in memory.
Please note it may be unsafe to interact with the context instance while the request is still being executed.
- Type Parameters:
T
- the result type of request execution.- Parameters:
target
- the target host for the request.requestProducers
- list of request producers.responseConsumers
- list of response consumers.context
- HTTP contextcallback
- future callback.- Returns:
- future representing pending completion of the operation.
-