Class MinimalHttpAsyncClient
- java.lang.Object
-
- org.apache.http.impl.nio.client.CloseableHttpAsyncClient
-
- org.apache.http.impl.nio.client.CloseableHttpPipeliningClient
-
- org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase
-
- org.apache.http.impl.nio.client.MinimalHttpAsyncClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,HttpAsyncClient
,HttpPipeliningClient
class MinimalHttpAsyncClient extends CloseableHttpAsyncClientBase
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase
CloseableHttpAsyncClientBase.Status
-
-
Field Summary
Fields Modifier and Type Field Description private NHttpClientConnectionManager
connmgr
private org.apache.http.ConnectionReuseStrategy
connReuseStrategy
private org.apache.http.protocol.HttpProcessor
httpProcessor
private org.apache.http.conn.ConnectionKeepAliveStrategy
keepaliveStrategy
private org.apache.commons.logging.Log
log
-
Constructor Summary
Constructors Constructor Description MinimalHttpAsyncClient(NHttpClientConnectionManager connmgr, java.util.concurrent.ThreadFactory threadFactory, org.apache.http.nio.NHttpClientEventHandler eventHandler, org.apache.http.protocol.HttpProcessor httpProcessor, org.apache.http.ConnectionReuseStrategy connReuseStrategy, org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy)
MinimalHttpAsyncClient(NHttpClientConnectionManager connmgr, org.apache.http.protocol.HttpProcessor httpProcessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.util.concurrent.Future<java.util.List<T>>
execute(org.apache.http.HttpHost target, java.util.List<? extends org.apache.http.nio.protocol.HttpAsyncRequestProducer> requestProducers, java.util.List<? extends org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> responseConsumers, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<java.util.List<T>> callback)
Initiates pipelined execution of a sequence of requests.<T> java.util.concurrent.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.-
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 Detail
-
log
private final org.apache.commons.logging.Log log
-
connmgr
private final NHttpClientConnectionManager connmgr
-
httpProcessor
private final org.apache.http.protocol.HttpProcessor httpProcessor
-
connReuseStrategy
private final org.apache.http.ConnectionReuseStrategy connReuseStrategy
-
keepaliveStrategy
private final org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy
-
-
Constructor Detail
-
MinimalHttpAsyncClient
public MinimalHttpAsyncClient(NHttpClientConnectionManager connmgr, java.util.concurrent.ThreadFactory threadFactory, org.apache.http.nio.NHttpClientEventHandler eventHandler, org.apache.http.protocol.HttpProcessor httpProcessor, org.apache.http.ConnectionReuseStrategy connReuseStrategy, org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy)
-
MinimalHttpAsyncClient
public MinimalHttpAsyncClient(NHttpClientConnectionManager connmgr, org.apache.http.protocol.HttpProcessor httpProcessor)
-
-
Method Detail
-
execute
public <T> java.util.concurrent.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> java.util.concurrent.Future<java.util.List<T>> execute(org.apache.http.HttpHost target, java.util.List<? extends org.apache.http.nio.protocol.HttpAsyncRequestProducer> requestProducers, java.util.List<? extends org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> responseConsumers, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<java.util.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.
-
-