|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.nio.protocol.HttpAsyncRequester
@Contract(threading=IMMUTABLE_CONDITIONAL) public class HttpAsyncRequester
HttpAsyncRequester
is a utility class that can be used
in conjunction with HttpAsyncRequestExecutor
to initiate execution
of asynchronous HTTP requests.
HttpAsyncRequestExecutor
Constructor Summary | |
---|---|
HttpAsyncRequester(HttpProcessor httpprocessor)
Creates new instance of HttpAsyncRequester. |
|
HttpAsyncRequester(HttpProcessor httpprocessor,
ConnectionReuseStrategy connReuseStrategy)
Creates new instance of HttpAsyncRequester. |
|
HttpAsyncRequester(HttpProcessor httpprocessor,
ConnectionReuseStrategy connReuseStrategy,
ExceptionLogger exceptionLogger)
Creates new instance of HttpAsyncRequester . |
|
HttpAsyncRequester(HttpProcessor httpprocessor,
ConnectionReuseStrategy reuseStrategy,
HttpParams params)
Deprecated. (4.3) use HttpAsyncRequester(HttpProcessor,
ConnectionReuseStrategy) |
Method Summary | ||
---|---|---|
|
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
ConnPool<HttpHost,E> connPool)
Initiates asynchronous HTTP request execution. |
|
|
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
ConnPool<HttpHost,E> connPool,
HttpContext context)
Initiates asynchronous HTTP request execution. |
|
|
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
ConnPool<HttpHost,E> connPool,
HttpContext context,
FutureCallback<T> callback)
Initiates asynchronous HTTP request execution. |
|
|
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
E poolEntry,
ConnPool<HttpHost,E> connPool,
HttpContext context,
FutureCallback<T> callback)
Initiates asynchronous HTTP request execution. |
|
|
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
NHttpClientConnection conn)
Initiates asynchronous HTTP request execution. |
|
|
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
NHttpClientConnection conn,
HttpContext context)
Initiates asynchronous HTTP request execution. |
|
|
execute(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
NHttpClientConnection conn,
HttpContext context,
FutureCallback<T> callback)
Initiates asynchronous HTTP request execution. |
|
|
executePipelined(HttpHost target,
List<? extends HttpAsyncRequestProducer> requestProducers,
List<? extends HttpAsyncResponseConsumer<T>> responseConsumers,
ConnPool<HttpHost,E> connPool,
HttpContext context,
FutureCallback<List<T>> callback)
Initiates asynchronous pipelined HTTP request execution. |
|
|
executePipelined(List<HttpAsyncRequestProducer> requestProducers,
List<HttpAsyncResponseConsumer<T>> responseConsumers,
E poolEntry,
ConnPool<HttpHost,E> connPool,
HttpContext context,
FutureCallback<List<T>> callback)
Initiates asynchronous pipelined 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 }). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public HttpAsyncRequester(HttpProcessor httpprocessor, ConnectionReuseStrategy reuseStrategy, HttpParams params)
HttpAsyncRequester(HttpProcessor,
ConnectionReuseStrategy)
public HttpAsyncRequester(HttpProcessor httpprocessor, ConnectionReuseStrategy connReuseStrategy, ExceptionLogger exceptionLogger)
HttpAsyncRequester
.
httpprocessor
- HTTP protocol processor.connReuseStrategy
- Connection re-use strategy. If null
DefaultConnectionReuseStrategy.INSTANCE
will be used.exceptionLogger
- Exception logger. If null
ExceptionLogger.NO_OP
will be used. Please note that the exception
logger will be only used to log I/O exception thrown while closing
Closeable
objects (such as HttpConnection
).public HttpAsyncRequester(HttpProcessor httpprocessor, ConnectionReuseStrategy connReuseStrategy)
public HttpAsyncRequester(HttpProcessor httpprocessor)
Method Detail |
---|
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.responseConsumer
- response consumer.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.responseConsumer
- response consumer.conn
- underlying HTTP connection.context
- HTTP context
public <T> Future<T> execute(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, NHttpClientConnection conn)
T
- the result type of request execution.requestProducer
- request producer.responseConsumer
- response consumer.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.responseConsumer
- response consumer.connPool
- pool of persistent reusable connections.context
- HTTP contextcallback
- future callback.
public <T,E extends PoolEntry<HttpHost,NHttpClientConnection>> Future<List<T>> executePipelined(HttpHost target, List<? extends HttpAsyncRequestProducer> requestProducers, List<? extends HttpAsyncResponseConsumer<T>> responseConsumers, ConnPool<HttpHost,E> connPool, HttpContext context, FutureCallback<List<T>> callback)
T
- the result type of request execution.E
- the connection pool entry type.target
- target host.requestProducers
- list of request producers.responseConsumers
- list of response consumers.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, E poolEntry, 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.responseConsumer
- response consumer.poolEntry
- leased pool entry. It will be automatically released
back to the pool when execution is completed.connPool
- pool of persistent reusable connections.context
- HTTP contextcallback
- future callback.
public <T,E extends PoolEntry<HttpHost,NHttpClientConnection>> Future<List<T>> executePipelined(List<HttpAsyncRequestProducer> requestProducers, List<HttpAsyncResponseConsumer<T>> responseConsumers, E poolEntry, ConnPool<HttpHost,E> connPool, HttpContext context, FutureCallback<List<T>> callback)
T
- the result type of request execution.E
- the connection pool entry type.requestProducers
- list of request producers.responseConsumers
- list of response consumers.poolEntry
- leased pool entry. It will be automatically released
back to the pool when execution is completed.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.responseConsumer
- response consumer.connPool
- pool of persistent reusable connections.context
- HTTP context
public <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.responseConsumer
- response consumer.connPool
- pool of persistent reusable connections.
protected void log(Exception ex)
Closeable
objects (such as
HttpConnection
}).
ex
- I/O exception thrown by Closeable.close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |