Class DefaultClientExchangeHandlerImpl<T>
java.lang.Object
org.apache.http.impl.nio.client.AbstractClientExchangeHandler
org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl<T>
- All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.http.concurrent.Cancellable, org.apache.http.nio.protocol.HttpAsyncClientExchangeHandler
Default implementation of
HttpAsyncClientExchangeHandler.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InternalClientExecprivate final org.apache.http.nio.protocol.HttpAsyncRequestProducerprivate final org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> private final org.apache.http.concurrent.BasicFuture<T> private final InternalStateFields inherited from class AbstractClientExchangeHandler
log -
Constructor Summary
ConstructorsConstructorDescriptionDefaultClientExchangeHandlerImpl(org.apache.commons.logging.Log log, org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, org.apache.http.client.protocol.HttpClientContext localContext, org.apache.http.concurrent.BasicFuture<T> resultFuture, NHttpClientConnectionManager connmgr, org.apache.http.ConnectionReuseStrategy connReuseStrategy, org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy, InternalClientExec exec) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidconsumeContent(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioctrl) (package private) boolean(package private) voidorg.apache.http.HttpRequestvoidvoidproduceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl) (package private) voidvoidvoidvoidresponseReceived(org.apache.http.HttpResponse response) voidstart()Methods inherited from class AbstractClientExchangeHandler
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, verifytRoute
-
Field Details
-
requestProducer
private final org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer -
responseConsumer
-
resultFuture
-
exec
-
state
-
-
Constructor Details
-
DefaultClientExchangeHandlerImpl
public DefaultClientExchangeHandlerImpl(org.apache.commons.logging.Log log, org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, org.apache.http.client.protocol.HttpClientContext localContext, org.apache.http.concurrent.BasicFuture<T> resultFuture, NHttpClientConnectionManager connmgr, org.apache.http.ConnectionReuseStrategy connReuseStrategy, org.apache.http.conn.ConnectionKeepAliveStrategy keepaliveStrategy, InternalClientExec exec)
-
-
Method Details
-
releaseResources
void releaseResources()- Specified by:
releaseResourcesin classAbstractClientExchangeHandler
-
executionFailed
- Specified by:
executionFailedin classAbstractClientExchangeHandler
-
executionCancelled
boolean executionCancelled()- Specified by:
executionCancelledin classAbstractClientExchangeHandler
-
start
- Throws:
org.apache.http.HttpExceptionIOException
-
generateRequest
public org.apache.http.HttpRequest generateRequest() throws IOException, org.apache.http.HttpException- Throws:
IOExceptionorg.apache.http.HttpException
-
produceContent
public void produceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl) throws IOException - Throws:
IOException
-
requestCompleted
public void requestCompleted() -
responseReceived
public void responseReceived(org.apache.http.HttpResponse response) throws IOException, org.apache.http.HttpException - Throws:
IOExceptionorg.apache.http.HttpException
-
consumeContent
public void consumeContent(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioctrl) throws IOException - Throws:
IOException
-
responseCompleted
- Throws:
IOExceptionorg.apache.http.HttpException
-
inputTerminated
public void inputTerminated() -
abortConnection
public void abortConnection()
-