Package com.yahoo.container.jdisc
Class AsyncHttpResponse
- java.lang.Object
-
- com.yahoo.container.jdisc.HttpResponse
-
- com.yahoo.container.jdisc.AsyncHttpResponse
-
- Direct Known Subclasses:
ExtendedResponse
,ProcessingResponse
public abstract class AsyncHttpResponse extends HttpResponse
HTTP response which supports async response rendering.- Author:
- bratseth, Steinar Knutsen
-
-
Field Summary
-
Fields inherited from class com.yahoo.container.jdisc.HttpResponse
DEFAULT_CHARACTER_ENCODING, DEFAULT_MIME_TYPE
-
-
Constructor Summary
Constructors Constructor Description AsyncHttpResponse(int status)
Create a new HTTP response with support for async output.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
render(java.io.OutputStream output)
Throws UnsupportedOperationException.abstract void
render(java.io.OutputStream output, com.yahoo.jdisc.handler.ContentChannel networkChannel, com.yahoo.jdisc.handler.CompletionHandler handler)
Render to output asynchronously.-
Methods inherited from class com.yahoo.container.jdisc.HttpResponse
complete, getCharacterEncoding, getContentType, getJdiscResponse, getLogValues, getRequestType, getStatus, headers, maxPendingBytes, populateAccessLogEntry, setRequestType, setStatus
-
-
-
-
Method Detail
-
render
public abstract void render(java.io.OutputStream output, com.yahoo.jdisc.handler.ContentChannel networkChannel, com.yahoo.jdisc.handler.CompletionHandler handler) throws java.io.IOException
Render to output asynchronously. The output stream will not be closed when this return. The implementation is responsible for closing the output (using the provided channel and completion handler) when (async) rendering is completed.- Parameters:
output
- the stream to which content should be renderednetworkChannel
- the channel which must be closed on completionhandler
- the completion handler to submit when closing the channel, may be null- Throws:
java.io.IOException
-
render
public final void render(java.io.OutputStream output)
Throws UnsupportedOperationException. Userender(OutputStream, ContentChannel, CompletionHandler)
instead.- Specified by:
render
in classHttpResponse
-
-