protected class AsyncProxyServlet.StreamReader extends IteratingCallback implements ReadListener
IteratingCallback.Action
Callback.Adapter
Modifier | Constructor and Description |
---|---|
protected |
AsyncProxyServlet.StreamReader(Request proxyRequest,
HttpServletRequest request,
DeferredContentProvider provider) |
Modifier and Type | Method and Description |
---|---|
void |
failed(Throwable x)
Invoked when the sub task fails.
|
void |
onAllDataRead() |
void |
onDataAvailable() |
void |
onError(Throwable t) |
protected void |
onRequestContent(Request proxyRequest,
HttpServletRequest request,
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, completed, isClosed, isFailed, isSucceeded, iterate, onCompleteFailure, onCompleteSuccess, reset, succeeded, toString
protected AsyncProxyServlet.StreamReader(Request proxyRequest, HttpServletRequest request, DeferredContentProvider provider)
public void onDataAvailable() throws IOException
onDataAvailable
in interface ReadListener
IOException
public void onAllDataRead() throws IOException
onAllDataRead
in interface ReadListener
IOException
public void onError(Throwable t)
onError
in interface ReadListener
protected IteratingCallback.Action process() throws 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
Exception
- if the sub task processing throwsprotected void onRequestContent(Request proxyRequest, HttpServletRequest request, DeferredContentProvider provider, byte[] buffer, int offset, int length, Callback callback)
public void failed(Throwable x)
IteratingCallback
super.failed(Throwable)
.failed
in interface Callback
failed
in class IteratingCallback
x
- the reason for the operation failureCopyright © 1995-2015 Webtide. All Rights Reserved.