public class AsyncHandlerWrapper<T> extends java.lang.Object implements AsyncHandler<T>
AsyncHandler.State
Constructor and Description |
---|
AsyncHandlerWrapper(AsyncHandler<T> asyncHandler,
java.util.concurrent.Semaphore available) |
Modifier and Type | Method and Description |
---|---|
AsyncHandler.State |
onBodyPartReceived(HttpResponseBodyPart bodyPart)
Invoked as soon as some response body part are received.
|
T |
onCompleted()
Invoked once the HTTP response processing is finished.
|
AsyncHandler.State |
onHeadersReceived(HttpResponseHeaders headers)
Invoked as soon as the HTTP headers has been received.
|
AsyncHandler.State |
onStatusReceived(HttpResponseStatus responseStatus)
Invoked as soon as the HTTP status line has been received
|
void |
onThrowable(java.lang.Throwable t)
Invoked when an unexpected exception occurs during the processing of the response.
|
public AsyncHandlerWrapper(AsyncHandler<T> asyncHandler, java.util.concurrent.Semaphore available)
public void onThrowable(java.lang.Throwable t)
onThrowable
in interface AsyncHandler<T>
t
- a Throwable
public AsyncHandler.State onBodyPartReceived(HttpResponseBodyPart bodyPart) throws java.lang.Exception
onBodyPartReceived
in interface AsyncHandler<T>
bodyPart
- response's body part.AsyncHandler.State
telling to CONTINUE or ABORT the current processing. Aborting will also close the connection.java.lang.Exception
- if something wrong happenspublic AsyncHandler.State onStatusReceived(HttpResponseStatus responseStatus) throws java.lang.Exception
onStatusReceived
in interface AsyncHandler<T>
responseStatus
- the status code and test of the responseAsyncHandler.State
telling to CONTINUE or ABORT the current processing.java.lang.Exception
- if something wrong happenspublic AsyncHandler.State onHeadersReceived(HttpResponseHeaders headers) throws java.lang.Exception
onHeadersReceived
in interface AsyncHandler<T>
headers
- the HTTP headers.AsyncHandler.State
telling to CONTINUE or ABORT the current processing.java.lang.Exception
- if something wrong happenspublic T onCompleted() throws java.lang.Exception
onCompleted
in interface AsyncHandler<T>
Future
java.lang.Exception
- if something wrong happensCopyright © 2017. All Rights Reserved.