public class HttpAsyncResponseConsumerWrapper<T> extends Object implements org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>
HttpAsyncResponseConsumer so we can be notified when the
current response(every response will callback the wrapper) received maybe completed or canceled,or failed.| Constructor and Description |
|---|
HttpAsyncResponseConsumerWrapper(org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel() |
void |
close() |
void |
consumeContent(org.apache.http.nio.ContentDecoder decoder,
org.apache.http.nio.IOControl ioctrl) |
void |
failed(Exception ex) |
Exception |
getException() |
T |
getResult() |
boolean |
isDone() |
void |
responseCompleted(org.apache.http.protocol.HttpContext context) |
void |
responseReceived(org.apache.http.HttpResponse response) |
public HttpAsyncResponseConsumerWrapper(org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> consumer)
public void responseReceived(org.apache.http.HttpResponse response)
throws IOException,
org.apache.http.HttpException
responseReceived in interface org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>IOExceptionorg.apache.http.HttpExceptionpublic void consumeContent(org.apache.http.nio.ContentDecoder decoder,
org.apache.http.nio.IOControl ioctrl)
throws IOException
consumeContent in interface org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>IOExceptionpublic void responseCompleted(org.apache.http.protocol.HttpContext context)
responseCompleted in interface org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>public void failed(Exception ex)
failed in interface org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>public Exception getException()
getException in interface org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>public T getResult()
getResult in interface org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>public boolean isDone()
isDone in interface org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean cancel()
cancel in interface org.apache.http.concurrent.CancellableCopyright © 2019 The Apache Software Foundation. All rights reserved.