protected class AsyncMiddleManServlet.ProxyReader extends IteratingCallback implements javax.servlet.ReadListener
IteratingCallback.Action
Callback.Completable, Callback.Completing, Callback.Nested
Invocable.InvocationType
Modifier and Type | Field and Description |
---|---|
private byte[] |
buffer |
private java.util.List<java.nio.ByteBuffer> |
buffers |
private javax.servlet.http.HttpServletRequest |
clientRequest |
private int |
contentLength |
private boolean |
expects100Continue |
private int |
length |
private DeferredContentProvider |
provider |
private Request |
proxyRequest |
private javax.servlet.http.HttpServletResponse |
proxyResponse |
__nonBlocking
Modifier | Constructor and Description |
---|---|
protected |
ProxyReader(javax.servlet.http.HttpServletRequest clientRequest,
javax.servlet.http.HttpServletResponse proxyResponse,
Request proxyRequest,
DeferredContentProvider provider) |
Modifier and Type | Method and Description |
---|---|
void |
onAllDataRead() |
protected void |
onCompleteFailure(java.lang.Throwable x)
Invoked when the overall task has completed with a failure.
|
void |
onDataAvailable() |
void |
onError(java.lang.Throwable t) |
protected IteratingCallback.Action |
process()
Method called by
IteratingCallback.iterate() to process the sub task. |
private void |
process(java.nio.ByteBuffer content,
Callback callback,
boolean finished) |
close, failed, isClosed, isFailed, isSucceeded, iterate, onCompleteSuccess, reset, succeeded, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInvocationType, getInvocationType, invokeNonBlocking, isNonBlockingInvocation
private final byte[] buffer
private final java.util.List<java.nio.ByteBuffer> buffers
private final javax.servlet.http.HttpServletRequest clientRequest
private final javax.servlet.http.HttpServletResponse proxyResponse
private final Request proxyRequest
private final DeferredContentProvider provider
private final int contentLength
private final boolean expects100Continue
private int length
protected ProxyReader(javax.servlet.http.HttpServletRequest clientRequest, javax.servlet.http.HttpServletResponse proxyResponse, Request proxyRequest, DeferredContentProvider provider)
public void onDataAvailable()
onDataAvailable
in interface javax.servlet.ReadListener
public void onAllDataRead() throws java.io.IOException
onAllDataRead
in interface javax.servlet.ReadListener
java.io.IOException
public void onError(java.lang.Throwable t)
onError
in interface javax.servlet.ReadListener
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
private void process(java.nio.ByteBuffer content, Callback callback, boolean finished) throws java.io.IOException
java.io.IOException
protected void onCompleteFailure(java.lang.Throwable x)
IteratingCallback
onCompleteFailure
in class IteratingCallback
x
- the throwable to indicate cause of failureIteratingCallback.onCompleteSuccess()