T - the result type of request execution.BasicAsyncClientExchangeHandler.@Deprecated public class BasicAsyncRequestExecutionHandler<T> extends Object implements HttpAsyncRequestExecutionHandler<T>
HttpAsyncRequestExecutionHandler that executes
a single HTTP request / response exchange.| Constructor and Description |
|---|
BasicAsyncRequestExecutionHandler(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
FutureCallback<T> callback,
HttpContext localContext,
HttpProcessor httpPocessor,
ConnectionReuseStrategy reuseStrategy,
HttpParams params)
Deprecated.
|
BasicAsyncRequestExecutionHandler(HttpAsyncRequestProducer requestProducer,
HttpAsyncResponseConsumer<T> responseConsumer,
HttpContext localContext,
HttpProcessor httpPocessor,
ConnectionReuseStrategy reuseStrategy,
HttpParams params)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Deprecated.
Cancels the ongoing operation or process.
|
void |
close()
Deprecated.
|
void |
consumeContent(ContentDecoder decoder,
IOControl ioControl)
Deprecated.
Invoked to process a chunk of content from the
ContentDecoder. |
void |
failed(Exception ex)
Deprecated.
Invoked to signal that the response processing terminated abnormally.
|
HttpRequest |
generateRequest()
Deprecated.
Invoked to generate a HTTP request message head.
|
ConnectionReuseStrategy |
getConnectionReuseStrategy()
Deprecated.
Returns
ConnectionReuseStrategy implementation to be used
to determine whether or not the underlying connection can be kept alive
after a particular HTTP request / response exchange. |
HttpContext |
getContext()
Deprecated.
Returns shared
HttpContext instance. |
Exception |
getException()
Deprecated.
Returns an exception in case of an abnormal termination.
|
Future<T> |
getFuture()
Deprecated.
|
HttpProcessor |
getHttpProcessor()
Deprecated.
Returns
HttpProcessor implementation to be used to process
HTTP request and response messages for protocol compliance. |
T |
getResult()
Deprecated.
Returns a result of the response processing, when available.
|
HttpHost |
getTarget()
Deprecated.
Invoked to obtain the request target host.
|
boolean |
isDone()
Deprecated.
Determines whether or not the response processing completed.
|
boolean |
isRepeatable()
Deprecated.
Determines whether or not this producer is capable of producing
HTTP request messages more than once.
|
void |
produceContent(ContentEncoder encoder,
IOControl ioControl)
Deprecated.
Invoked to write out a chunk of content to the
ContentEncoder. |
void |
requestCompleted(HttpContext context)
Deprecated.
Invoked to signal that the request has been fully written out.
|
void |
resetRequest()
Deprecated.
Invoked to reset the producer to its initial state.
|
void |
responseCompleted(HttpContext context)
Deprecated.
Invoked to signal that the response has been fully processed.
|
void |
responseReceived(HttpResponse response)
Deprecated.
Invoked when a HTTP response message is received.
|
public BasicAsyncRequestExecutionHandler(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, FutureCallback<T> callback, HttpContext localContext, HttpProcessor httpPocessor, ConnectionReuseStrategy reuseStrategy, HttpParams params)
public BasicAsyncRequestExecutionHandler(HttpAsyncRequestProducer requestProducer, HttpAsyncResponseConsumer<T> responseConsumer, HttpContext localContext, HttpProcessor httpPocessor, ConnectionReuseStrategy reuseStrategy, HttpParams params)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic HttpHost getTarget()
HttpAsyncRequestProducergetTarget in interface HttpAsyncRequestProducerpublic HttpRequest generateRequest() throws IOException, HttpException
HttpAsyncRequestProducerHttpEntityEnclosingRequest interface
if it is to enclose a content entity. The HttpAsyncRequestProducer.produceContent(
ContentEncoder, IOControl) method will not be invoked if
HttpEntityEnclosingRequest.getEntity()
returns null.generateRequest in interface HttpAsyncRequestProducerIOException - in case of an I/O errorHttpException - in case of HTTP protocol violationpublic void produceContent(ContentEncoder encoder, IOControl ioControl) throws IOException
HttpAsyncRequestProducerContentEncoder.
The IOControl interface can be used to suspend output event
notifications if the producer is temporarily unable to produce more content.
When all content is finished, the producer MUST call
ContentEncoder.complete(). Failure to do so may cause the entity
to be incorrectly delimited.
Please note that the ContentEncoder object is not thread-safe and
should only be used within the context of this method call.
The IOControl object can be shared and used on other thread
to resume output event notifications when more content is made available.
produceContent in interface HttpAsyncRequestProducerencoder - content encoder.ioControl - I/O control of the underlying connection.IOException - in case of an I/O errorpublic void requestCompleted(HttpContext context)
HttpAsyncRequestProducerrequestCompleted in interface HttpAsyncRequestProducercontext - HTTP contextpublic boolean isRepeatable()
HttpAsyncRequestProducerisRepeatable in interface HttpAsyncRequestProducerpublic void resetRequest()
HttpAsyncRequestProducerresetRequest in interface HttpAsyncRequestProducerpublic void responseReceived(HttpResponse response) throws IOException, HttpException
HttpAsyncResponseConsumerHttpAsyncResponseConsumer.consumeContent(ContentDecoder, IOControl) method
will be invoked only if the response messages has a content entity
enclosed.responseReceived in interface HttpAsyncResponseConsumer<T>response - HTTP response message.IOException - in case of an I/O errorHttpException - in case of HTTP protocol violationpublic void consumeContent(ContentDecoder decoder, IOControl ioControl) throws IOException
HttpAsyncResponseConsumerContentDecoder.
The IOControl interface can be used to suspend input event
notifications if the consumer is temporarily unable to process content.
The consumer can use the ContentDecoder.isCompleted() method
to find out whether or not the message content has been fully consumed.
Please note that the ContentDecoder object is not thread-safe and
should only be used within the context of this method call.
The IOControl object can be shared and used on other thread
to resume input event notifications when the consumer is capable of
processing more content.
consumeContent in interface HttpAsyncResponseConsumer<T>decoder - content decoder.ioControl - I/O control of the underlying connection.IOException - in case of an I/O errorpublic void failed(Exception ex)
HttpAsyncRequestProducerfailed in interface HttpAsyncRequestProducerfailed in interface HttpAsyncResponseConsumer<T>ex - exceptionpublic boolean cancel()
Cancellablecancel in interface Cancellabletrue if the operation or process has been cancelled as a result of
this method call or false if it has already been cancelled or not started.public void responseCompleted(HttpContext context)
HttpAsyncResponseConsumerresponseCompleted in interface HttpAsyncResponseConsumer<T>context - HTTP contextpublic T getResult()
HttpAsyncResponseConsumernull if the response processing is still ongoing.getResult in interface HttpAsyncResponseConsumer<T>HttpAsyncResponseConsumer.isDone()public Exception getException()
HttpAsyncResponseConsumernull if the response processing is still ongoing
or if it completed successfully.getException in interface HttpAsyncResponseConsumer<T>HttpAsyncResponseConsumer.isDone()public HttpContext getContext()
HttpAsyncRequestExecutionHandlerHttpContext instance.getContext in interface HttpAsyncRequestExecutionHandler<T>public HttpProcessor getHttpProcessor()
HttpAsyncRequestExecutionHandlerHttpProcessor implementation to be used to process
HTTP request and response messages for protocol compliance.getHttpProcessor in interface HttpAsyncRequestExecutionHandler<T>public ConnectionReuseStrategy getConnectionReuseStrategy()
HttpAsyncRequestExecutionHandlerConnectionReuseStrategy implementation to be used
to determine whether or not the underlying connection can be kept alive
after a particular HTTP request / response exchange.getConnectionReuseStrategy in interface HttpAsyncRequestExecutionHandler<T>public boolean isDone()
HttpAsyncResponseConsumerHttpAsyncResponseConsumer.getResult()
can be used to obtain the result. If the response processing terminated
abnormally HttpAsyncResponseConsumer.getException() can be used to obtain the cause.isDone in interface HttpAsyncResponseConsumer<T>Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.