Package com.yahoo.processing.handler
Class ProcessingResponse
- java.lang.Object
-
- com.yahoo.container.jdisc.HttpResponse
-
- com.yahoo.container.jdisc.AsyncHttpResponse
-
- com.yahoo.processing.handler.ProcessingResponse
-
public class ProcessingResponse extends AsyncHttpResponse
A response from running a request through processing. This response is just a wrapper of the knowhow needed to render the Response from processing.- 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 ProcessingResponse(int status, Request processingRequest, Response processingResponse, Renderer renderer, java.util.concurrent.Executor renderingExecutor, Execution execution)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete()
Complete creation of this response.java.lang.String
getCharacterEncoding()
The name of the encoding for the response contents, if applicable.java.lang.String
getContentType()
The MIME type of the response contents or null.java.lang.Iterable<Execution.Trace.LogValue>
getLogValues()
void
render(java.io.OutputStream stream, com.yahoo.jdisc.handler.ContentChannel channel, com.yahoo.jdisc.handler.CompletionHandler completionHandler)
Render to output asynchronously.-
Methods inherited from class com.yahoo.container.jdisc.AsyncHttpResponse
render
-
Methods inherited from class com.yahoo.container.jdisc.HttpResponse
getJdiscResponse, getRequestType, getStatus, headers, populateAccessLogEntry, setRequestType, setStatus
-
-
-
-
Method Detail
-
render
public void render(java.io.OutputStream stream, com.yahoo.jdisc.handler.ContentChannel channel, com.yahoo.jdisc.handler.CompletionHandler completionHandler) throws java.io.IOException
Description copied from class:AsyncHttpResponse
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.- Specified by:
render
in classAsyncHttpResponse
- Parameters:
stream
- the stream to which content should be renderedchannel
- the channel which must be closed on completioncompletionHandler
- the completion handler to submit when closing the channel, may be null- Throws:
java.io.IOException
-
getContentType
public java.lang.String getContentType()
Description copied from class:HttpResponse
The MIME type of the response contents or null. If null is returned, no content type header is added to the HTTP response.- Overrides:
getContentType
in classHttpResponse
- Returns:
- by default
HttpResponse.DEFAULT_MIME_TYPE
-
getCharacterEncoding
public java.lang.String getCharacterEncoding()
Description copied from class:HttpResponse
The name of the encoding for the response contents, if applicable. Return null if character set is not applicable to the response in question (e.g. binary formats). If null is returned, not "charset" element is added to the content type header.- Overrides:
getCharacterEncoding
in classHttpResponse
- Returns:
- by default
HttpResponse.DEFAULT_CHARACTER_ENCODING
-
complete
public void complete()
Description copied from class:HttpResponse
Complete creation of this response. This is called by the container once just before writing the response header back to the caller, so this is the last moment at which status and headers can be determined. This default implementation does nothing.- Overrides:
complete
in classHttpResponse
-
getLogValues
public java.lang.Iterable<Execution.Trace.LogValue> getLogValues()
- Overrides:
getLogValues
in classHttpResponse
-
-