static class BufferingHttpClientHandler.ExecutionHandlerAdaptor extends java.lang.Object implements NHttpRequestExecutionHandler
| Modifier and Type | Field and Description |
|---|---|
private HttpRequestExecutionHandler |
execHandler |
| Constructor and Description |
|---|
ExecutionHandlerAdaptor(HttpRequestExecutionHandler execHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
finalizeContext(HttpContext context)
Triggered when the connection is terminated.
|
void |
handleResponse(HttpResponse response,
HttpContext context)
Triggered when an HTTP response is ready to be processed.
|
void |
initalizeContext(HttpContext context,
java.lang.Object attachment)
Triggered when a new connection has been established and the
HTTP context needs to be initialized.
|
ConsumingNHttpEntity |
responseEntity(HttpResponse response,
HttpContext context)
Triggered when a response is received with an entity.
|
HttpRequest |
submitRequest(HttpContext context)
Triggered when the underlying connection is ready to send a new
HTTP request to the target host.
|
private final HttpRequestExecutionHandler execHandler
public ExecutionHandlerAdaptor(HttpRequestExecutionHandler execHandler)
public void initalizeContext(HttpContext context, java.lang.Object attachment)
NHttpRequestExecutionHandlerThe attachment object is the same object which was passed to the connecting I/O reactor when the connection request was made. The attachment may optionally contain some state information required in order to correctly initalize the HTTP context.
initalizeContext in interface NHttpRequestExecutionHandlercontext - the actual HTTP contextattachment - the object passed to the connecting I/O reactor
upon the request for a new connection.ConnectingIOReactor.connect(java.net.SocketAddress, java.net.SocketAddress, java.lang.Object, org.apache.http.nio.reactor.SessionRequestCallback)public void finalizeContext(HttpContext context)
NHttpRequestExecutionHandlerfinalizeContext in interface NHttpRequestExecutionHandlercontext - the actual HTTP contextpublic HttpRequest submitRequest(HttpContext context)
NHttpRequestExecutionHandlernull if the client is not yet ready to send a
request. In this case the connection will remain open and
can be activated at a later point.
If the request has an entity, the entity must be an
instance of ProducingNHttpEntity.
submitRequest in interface NHttpRequestExecutionHandlercontext - the actual HTTP contextnull if no
request needs to be sentpublic ConsumingNHttpEntity responseEntity(HttpResponse response, HttpContext context) throws java.io.IOException
NHttpRequestExecutionHandlerConsumingNHttpEntity that will be used to consume the
entity. null is a valid response value, and will indicate
that the entity should be silently ignored.
After the entity is fully consumed,
NHttpRequestExecutionHandler.handleResponse(HttpResponse, HttpContext)
is called to notify a full response & entity are ready to be processed.
responseEntity in interface NHttpRequestExecutionHandlerresponse - The response containing the existing entity.context - the actual HTTP contextjava.io.IOExceptionpublic void handleResponse(HttpResponse response, HttpContext context) throws java.io.IOException
NHttpRequestExecutionHandlerhandleResponse in interface NHttpRequestExecutionHandlerresponse - the HTTP response to be processedcontext - the actual HTTP contextjava.io.IOException