private class HttpSenderOverHTTP.HeadersCallback extends IteratingCallback
IteratingCallback.Action
Callback.Completable, Callback.Completing, Callback.Nested
Invocable.InvocationType
Modifier and Type | Field and Description |
---|---|
private Callback |
callback |
private java.nio.ByteBuffer |
chunkBuffer |
private java.nio.ByteBuffer |
contentBuffer |
private HttpExchange |
exchange |
private boolean |
generated |
private java.nio.ByteBuffer |
headerBuffer |
private HttpConnectionOverHTTP |
httpConnectionOverHTTP |
private boolean |
lastContent |
private MetaData.Request |
metaData |
__nonBlocking
Constructor and Description |
---|
HeadersCallback(HttpExchange exchange,
HttpContent content,
Callback callback,
HttpConnectionOverHTTP httpConnectionOverHTTP) |
Modifier and Type | Method and Description |
---|---|
void |
failed(java.lang.Throwable x)
Invoked when the sub task fails.
|
protected void |
onCompleteSuccess()
Invoked when the overall task has completed successfully.
|
protected IteratingCallback.Action |
process()
Method called by
IteratingCallback.iterate() to process the sub task. |
private void |
release() |
void |
succeeded()
Invoked when the sub task succeeds.
|
close, isClosed, isFailed, isSucceeded, iterate, onCompleteFailure, reset, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInvocationType, getInvocationType, invokeNonBlocking, isNonBlockingInvocation
private final HttpExchange exchange
private final Callback callback
private final MetaData.Request metaData
private final HttpConnectionOverHTTP httpConnectionOverHTTP
private java.nio.ByteBuffer headerBuffer
private java.nio.ByteBuffer chunkBuffer
private java.nio.ByteBuffer contentBuffer
private boolean lastContent
private boolean generated
public HeadersCallback(HttpExchange exchange, HttpContent content, Callback callback, HttpConnectionOverHTTP httpConnectionOverHTTP)
protected IteratingCallback.Action process() throws java.lang.Exception
IteratingCallback
IteratingCallback.iterate()
to process the sub task.
Implementations must start the asynchronous execution of the sub task (if any) and return an appropriate action:
IteratingCallback.Action.IDLE
when no sub tasks are available for execution
but the overall job is not completed yetIteratingCallback.Action.SCHEDULED
when the sub task asynchronous execution
has been startedIteratingCallback.Action.SUCCEEDED
when the overall job is completedprocess
in class IteratingCallback
java.lang.Exception
public void succeeded()
IteratingCallback
super.succeeded()
.succeeded
in interface Callback
succeeded
in class IteratingCallback
Callback.failed(Throwable)
public void failed(java.lang.Throwable x)
IteratingCallback
super.failed(Throwable)
.failed
in interface Callback
failed
in class IteratingCallback
x
- the reason for the operation failureprotected void onCompleteSuccess()
IteratingCallback
onCompleteSuccess
in class IteratingCallback
IteratingCallback.onCompleteFailure(Throwable)
private void release()