@Pipelined class PipeliningClientExchangeHandlerImpl<T> extends AbstractClientExchangeHandler
HttpAsyncClientExchangeHandler implementation
that supports HTTP message pipelining.
Instances of this class are expected to be accessed by one thread at a time only.
The AbstractClientExchangeHandler.cancel() method can be called concurrently by multiple threads.
| Modifier and Type | Field and Description |
|---|---|
private org.apache.http.protocol.HttpProcessor |
httpProcessor |
private org.apache.http.client.protocol.HttpClientContext |
localContext |
private java.util.Queue<org.apache.http.nio.protocol.HttpAsyncRequestProducer> |
requestProducerQueue |
private java.util.concurrent.atomic.AtomicReference<org.apache.http.nio.protocol.HttpAsyncRequestProducer> |
requestProducerRef |
private java.util.Queue<org.apache.http.HttpRequest> |
requestQueue |
private java.util.Queue<org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> |
responseConsumerQueue |
private java.util.concurrent.atomic.AtomicReference<org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> |
responseConsumerRef |
private org.apache.http.concurrent.BasicFuture<java.util.List<T>> |
resultFuture |
private java.util.Queue<T> |
resultQueue |
private org.apache.http.HttpHost |
target |
log| Constructor and Description |
|---|
PipeliningClientExchangeHandlerImpl(org.apache.commons.logging.Log log,
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.client.protocol.HttpClientContext localContext,
org.apache.http.concurrent.BasicFuture<java.util.List<T>> resultFuture,
NHttpClientConnectionManager connmgr,
org.apache.http.protocol.HttpProcessor httpProcessor,
org.apache.http.ConnectionReuseStrategy connReuseStrategy,
org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortConnection() |
private void |
closeConsumer(org.apache.http.nio.protocol.HttpAsyncResponseConsumer<?> responseConsumer) |
private void |
closeProducer(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer) |
void |
consumeContent(org.apache.http.nio.ContentDecoder decoder,
org.apache.http.nio.IOControl ioctrl) |
(package private) boolean |
executionCancelled() |
(package private) void |
executionFailed(java.lang.Exception ex) |
org.apache.http.HttpRequest |
generateRequest() |
void |
inputTerminated() |
void |
produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl) |
(package private) void |
releaseResources() |
void |
requestCompleted() |
void |
responseCompleted() |
void |
responseReceived(org.apache.http.HttpResponse response) |
void |
start() |
cancel, close, discardConnection, failed, getActualRoute, getConnection, getCurrentRequest, getCurrentResponse, getId, getRoute, isCompleted, isDone, isRouteEstablished, manageConnectionPersistence, markCompleted, markConnectionNonReusable, onRouteComplete, onRouteToProxy, onRouteToTarget, onRouteTunnelToTarget, onRouteUpgrade, releaseConnection, requestConnection, setCurrentRequest, setCurrentResponse, setRoute, verifytRouteprivate final org.apache.http.HttpHost target
private final java.util.Queue<org.apache.http.nio.protocol.HttpAsyncRequestProducer> requestProducerQueue
private final java.util.Queue<org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> responseConsumerQueue
private final java.util.Queue<org.apache.http.HttpRequest> requestQueue
private final java.util.Queue<T> resultQueue
private final org.apache.http.client.protocol.HttpClientContext localContext
private final org.apache.http.concurrent.BasicFuture<java.util.List<T>> resultFuture
private final org.apache.http.protocol.HttpProcessor httpProcessor
private final java.util.concurrent.atomic.AtomicReference<org.apache.http.nio.protocol.HttpAsyncRequestProducer> requestProducerRef
private final java.util.concurrent.atomic.AtomicReference<org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> responseConsumerRef
public PipeliningClientExchangeHandlerImpl(org.apache.commons.logging.Log log,
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.client.protocol.HttpClientContext localContext,
org.apache.http.concurrent.BasicFuture<java.util.List<T>> resultFuture,
NHttpClientConnectionManager connmgr,
org.apache.http.protocol.HttpProcessor httpProcessor,
org.apache.http.ConnectionReuseStrategy connReuseStrategy,
org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy)
private void closeProducer(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer)
private void closeConsumer(org.apache.http.nio.protocol.HttpAsyncResponseConsumer<?> responseConsumer)
void releaseResources()
releaseResources in class AbstractClientExchangeHandlervoid executionFailed(java.lang.Exception ex)
executionFailed in class AbstractClientExchangeHandlerboolean executionCancelled()
executionCancelled in class AbstractClientExchangeHandlerpublic void start()
throws org.apache.http.HttpException,
java.io.IOException
org.apache.http.HttpExceptionjava.io.IOExceptionpublic org.apache.http.HttpRequest generateRequest()
throws java.io.IOException,
org.apache.http.HttpException
java.io.IOExceptionorg.apache.http.HttpExceptionpublic void produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl)
throws java.io.IOException
java.io.IOExceptionpublic void requestCompleted()
public void responseReceived(org.apache.http.HttpResponse response)
throws java.io.IOException,
org.apache.http.HttpException
java.io.IOExceptionorg.apache.http.HttpExceptionpublic void consumeContent(org.apache.http.nio.ContentDecoder decoder,
org.apache.http.nio.IOControl ioctrl)
throws java.io.IOException
java.io.IOExceptionpublic void responseCompleted()
throws java.io.IOException,
org.apache.http.HttpException
java.io.IOExceptionorg.apache.http.HttpExceptionpublic void inputTerminated()
public void abortConnection()