T
- Type of the value that will be returned by the associated Future
public abstract class AsyncCompletionHandler<T> extends Object implements com.ning.http.client.AsyncHandler<T>, com.ning.http.client.ProgressAsyncHandler<T>
AsyncHandler
augmented with an onCompleted(Response)
convenience method which gets called
when the Response
processing is finished. This class also implement the ProgressAsyncHandler
callback,
all doing nothing except returning AsyncHandler.STATE.CONTINUE
This is a modified version from the original file from AHC, where the only change is making the logger static.Constructor and Description |
---|
AsyncCompletionHandler() |
Modifier and Type | Method and Description |
---|---|
com.ning.http.client.AsyncHandler.STATE |
onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart content) |
T |
onCompleted() |
abstract T |
onCompleted(com.ning.http.client.Response response)
Invoked once the HTTP response processing is finished.
|
com.ning.http.client.AsyncHandler.STATE |
onContentWriteCompleted()
Invoked when the content (a
File , String or FileInputStream has been fully
written on the I/O socket. |
com.ning.http.client.AsyncHandler.STATE |
onContentWriteProgress(long amount,
long current,
long total)
Invoked when the I/O operation associated with the
Request body as been progressed. |
com.ning.http.client.AsyncHandler.STATE |
onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers) |
com.ning.http.client.AsyncHandler.STATE |
onHeaderWriteCompleted()
Invoked when the content (a
File , String or FileInputStream has been fully
written on the I/O socket. |
com.ning.http.client.AsyncHandler.STATE |
onStatusReceived(com.ning.http.client.HttpResponseStatus status) |
void |
onThrowable(Throwable t) |
public com.ning.http.client.AsyncHandler.STATE onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart content) throws Exception
public com.ning.http.client.AsyncHandler.STATE onStatusReceived(com.ning.http.client.HttpResponseStatus status) throws Exception
public com.ning.http.client.AsyncHandler.STATE onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers) throws Exception
public void onThrowable(Throwable t)
onThrowable
in interface com.ning.http.client.AsyncHandler<T>
public abstract T onCompleted(com.ning.http.client.Response response) throws Exception
public com.ning.http.client.AsyncHandler.STATE onHeaderWriteCompleted()
File
, String
or FileInputStream
has been fully
written on the I/O socket.onHeaderWriteCompleted
in interface com.ning.http.client.ProgressAsyncHandler<T>
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.public com.ning.http.client.AsyncHandler.STATE onContentWriteCompleted()
File
, String
or FileInputStream
has been fully
written on the I/O socket.onContentWriteCompleted
in interface com.ning.http.client.ProgressAsyncHandler<T>
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.public com.ning.http.client.AsyncHandler.STATE onContentWriteProgress(long amount, long current, long total)
Request
body as been progressed.onContentWriteProgress
in interface com.ning.http.client.ProgressAsyncHandler<T>
amount
- The amount of bytes to transfer.current
- The amount of bytes transferredtotal
- The total number of bytes transferredAsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.