protected class AsyncProxyServlet.StreamReader extends IteratingCallback implements javax.servlet.ReadListener
IteratingCallback.ActionCallback.Completable, Callback.NestedInvocable.InvocationType| Modifier and Type | Field and Description |
|---|---|
private byte[] |
buffer |
private DeferredContentProvider |
provider |
private Request |
proxyRequest |
private javax.servlet.http.HttpServletRequest |
request |
private javax.servlet.http.HttpServletResponse |
response |
__nonBlocking| Modifier | Constructor and Description |
|---|---|
protected |
StreamReader(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Request proxyRequest,
DeferredContentProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
void |
failed(java.lang.Throwable x)
Invoked when the sub task fails.
|
void |
onAllDataRead() |
void |
onDataAvailable() |
void |
onError(java.lang.Throwable t) |
protected void |
onRequestContent(javax.servlet.http.HttpServletRequest request,
Request proxyRequest,
DeferredContentProvider provider,
byte[] buffer,
int offset,
int length,
Callback callback) |
protected IteratingCallback.Action |
process()
Method called by
IteratingCallback.iterate() to process the sub task. |
close, isClosed, isFailed, isSucceeded, iterate, onCompleteFailure, onCompleteSuccess, reset, succeeded, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInvocationType, getInvocationType, invokeNonBlocking, isNonBlockingInvocationprivate final byte[] buffer
private final javax.servlet.http.HttpServletRequest request
private final javax.servlet.http.HttpServletResponse response
private final Request proxyRequest
private final DeferredContentProvider provider
protected StreamReader(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Request proxyRequest,
DeferredContentProvider provider)
public void onDataAvailable()
throws java.io.IOException
onDataAvailable in interface javax.servlet.ReadListenerjava.io.IOExceptionpublic void onAllDataRead()
throws java.io.IOException
onAllDataRead in interface javax.servlet.ReadListenerjava.io.IOExceptionpublic void onError(java.lang.Throwable t)
onError in interface javax.servlet.ReadListenerprotected IteratingCallback.Action process() throws java.lang.Exception
IteratingCallbackIteratingCallback.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 IteratingCallbackjava.lang.Exceptionprotected void onRequestContent(javax.servlet.http.HttpServletRequest request,
Request proxyRequest,
DeferredContentProvider provider,
byte[] buffer,
int offset,
int length,
Callback callback)
public void failed(java.lang.Throwable x)
IteratingCallbacksuper.failed(Throwable).failed in interface Callbackfailed in class IteratingCallbackx - the reason for the operation failure