@Contract(threading=SAFE) public abstract class CloseableHttpAsyncClient extends java.lang.Object implements HttpAsyncClient, java.io.Closeable
HttpAsyncClient
that also implements Closeable
.Constructor and Description |
---|
CloseableHttpAsyncClient() |
Modifier and Type | Method and Description |
---|---|
private org.apache.http.HttpHost |
determineTarget(org.apache.http.client.methods.HttpUriRequest request) |
<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.concurrent.FutureCallback<T> callback)
Initiates asynchronous HTTP request execution using the default
context.
|
java.util.concurrent.Future<org.apache.http.HttpResponse> |
execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback)
Initiates asynchronous HTTP request execution against the given target.
|
java.util.concurrent.Future<org.apache.http.HttpResponse> |
execute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context,
org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback)
Initiates asynchronous HTTP request execution against the given target
using the given context.
|
java.util.concurrent.Future<org.apache.http.HttpResponse> |
execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback)
Initiates asynchronous HTTP request execution.
|
java.util.concurrent.Future<org.apache.http.HttpResponse> |
execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.protocol.HttpContext context,
org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback)
Initiates asynchronous HTTP request execution using the given
context.
|
abstract boolean |
isRunning() |
abstract void |
start() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
public abstract boolean isRunning()
public abstract void start()
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.concurrent.FutureCallback<T> callback)
HttpAsyncClient
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.
execute
in interface HttpAsyncClient
T
- the result type of request execution.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.callback
- future callback.public java.util.concurrent.Future<org.apache.http.HttpResponse> execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback)
HttpAsyncClient
Please note it may be unsafe to interact with the context instance while the request is still being executed.
execute
in interface HttpAsyncClient
target
- the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request
- the request to executecontext
- the context to use for the execution, or
null
to use the default contextcallback
- future callback.public java.util.concurrent.Future<org.apache.http.HttpResponse> execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback)
HttpAsyncClient
execute
in interface HttpAsyncClient
target
- the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request
- the request to executecallback
- future callback.public java.util.concurrent.Future<org.apache.http.HttpResponse> execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback)
HttpAsyncClient
execute
in interface HttpAsyncClient
request
- the request to executecallback
- future callback.public java.util.concurrent.Future<org.apache.http.HttpResponse> execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback)
HttpAsyncClient
Please note it may be unsafe to interact with the context instance while the request is still being executed.
execute
in interface HttpAsyncClient
request
- the request to executecontext
- HTTP contextcallback
- future callback.private org.apache.http.HttpHost determineTarget(org.apache.http.client.methods.HttpUriRequest request) throws org.apache.http.client.ClientProtocolException
org.apache.http.client.ClientProtocolException