@Immutable public class HttpAsyncRequester extends Object
HttpAsyncRequestExecutor
to initiate execution
of asynchronous HTTP requests.HttpAsyncRequestExecutor
Constructor and Description |
---|
HttpAsyncRequester(HttpProcessor httppocessor,
ConnectionReuseStrategy reuseStrategy,
HttpParams params) |
Modifier and Type | Method and Description |
---|---|
<T,E extends PoolEntry<HttpHost,NHttpClientConnection>> |
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
ConnPool<HttpHost,E> connPool)
Initiates asynchronous HTTP request execution.
|
<T,E extends PoolEntry<HttpHost,NHttpClientConnection>> |
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
ConnPool<HttpHost,E> connPool,
HttpContext context)
Initiates asynchronous HTTP request execution.
|
<T,E extends PoolEntry<HttpHost,NHttpClientConnection>> |
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
ConnPool<HttpHost,E> connPool,
HttpContext context,
FutureCallback<T> callback)
Initiates asynchronous HTTP request execution.
|
<T> Future<T> |
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
NHttpClientConnection conn)
Initiates asynchronous HTTP request execution.
|
<T> Future<T> |
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
NHttpClientConnection conn,
HttpContext context)
Initiates asynchronous HTTP request execution.
|
<T> Future<T> |
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
NHttpClientConnection conn,
HttpContext context,
FutureCallback<T> callback)
Initiates asynchronous HTTP request execution.
|
protected void |
log(Exception ex)
This method can be used to log I/O exception thrown while closing
Closeable
objects (such as HttpConnection }). |
public HttpAsyncRequester(HttpProcessor httppocessor, ConnectionReuseStrategy reuseStrategy, HttpParams params)
public <T> Future<T> execute(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, NHttpClientConnection conn, HttpContext context, FutureCallback<T> callback)
T
- the result type of request execution.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.conn
- underlying HTTP connection.context
- HTTP contextcallback
- future callback.public <T> Future<T> execute(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, NHttpClientConnection conn, HttpContext context)
T
- the result type of request execution.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.conn
- underlying HTTP connection.context
- HTTP contextpublic <T> Future<T> execute(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, NHttpClientConnection conn)
T
- the result type of request execution.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.conn
- underlying HTTP connection.public <T,E extends PoolEntry<HttpHost,NHttpClientConnection>> Future<T> execute(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, ConnPool<HttpHost,E> connPool, HttpContext context, FutureCallback<T> callback)
T
- the result type of request execution.E
- the connection pool entry type.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.connPool
- pool of persistent reusable connections.context
- HTTP contextcallback
- future callback.public <T,E extends PoolEntry<HttpHost,NHttpClientConnection>> Future<T> execute(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, ConnPool<HttpHost,E> connPool, HttpContext context)
T
- the result type of request execution.E
- the connection pool entry type.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.connPool
- pool of persistent reusable connections.context
- HTTP contextpublic <T,E extends PoolEntry<HttpHost,NHttpClientConnection>> Future<T> execute(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, ConnPool<HttpHost,E> connPool)
T
- the result type of request execution.E
- the connection pool entry type.requestProducer
- request producer callback.responseConsumer
- response consumer callaback.connPool
- pool of persistent reusable connections.protected void log(Exception ex)
Closeable
objects (such as HttpConnection
}).ex
- I/O exception thrown by Closeable.close()
Copyright © 2005-2015 The Apache Software Foundation. All Rights Reserved.