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
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
ConstructorDescriptionAsyncHttpResponse
(int status) Create a new HTTP response with support for async output. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
render
(OutputStream output) Throws UnsupportedOperationException.abstract void
render
(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
-
Constructor Details
-
AsyncHttpResponse
public AsyncHttpResponse(int status) Create a new HTTP response with support for async output.- Parameters:
status
- the HTTP status code for jdisc- See Also:
-
Response
-
-
Method Details
-
render
public abstract void render(OutputStream output, com.yahoo.jdisc.handler.ContentChannel networkChannel, com.yahoo.jdisc.handler.CompletionHandler handler) throws 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:
IOException
-
render
Throws UnsupportedOperationException. Userender(OutputStream, ContentChannel, CompletionHandler)
instead.- Specified by:
render
in classHttpResponse
-