public class ServletServerHttpResponse extends AbstractListenerServerHttpResponse
ServerHttpResponse
to the Servlet HttpServletResponse
.Constructor and Description |
---|
ServletServerHttpResponse(HttpServletResponse response,
AsyncContext asyncContext,
DataBufferFactory bufferFactory,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyCookies()
Add cookies from
AbstractServerHttpResponse.getHeaders() to the underlying response. |
protected void |
applyHeaders()
Apply header changes from
AbstractServerHttpResponse.getHeaders() to the underlying response. |
protected void |
applyStatusCode()
Write the status code to the underlying response.
|
protected org.reactivestreams.Processor<? super org.reactivestreams.Publisher<? extends DataBuffer>,Void> |
createBodyFlushProcessor()
Abstract template method to create a
Processor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output. |
HttpServletResponse |
getServletResponse() |
protected int |
writeToOutputStream(DataBuffer dataBuffer)
Write the DataBuffer to the response body OutputStream.
|
writeAndFlushWithInternal, writeWithInternal
addCookie, beforeCommit, bufferFactory, doCommit, doCommit, getCookies, getHeaders, getStatusCode, isCommitted, setComplete, setStatusCode, writeAndFlushWith, writeWith
public ServletServerHttpResponse(HttpServletResponse response, AsyncContext asyncContext, DataBufferFactory bufferFactory, int bufferSize) throws IOException
IOException
public HttpServletResponse getServletResponse()
protected void applyStatusCode()
AbstractServerHttpResponse
applyStatusCode
in class AbstractServerHttpResponse
protected void applyHeaders()
AbstractServerHttpResponse
AbstractServerHttpResponse.getHeaders()
to the underlying response.
This method is called once only.applyHeaders
in class AbstractServerHttpResponse
protected void applyCookies()
AbstractServerHttpResponse
AbstractServerHttpResponse.getHeaders()
to the underlying response.
This method is called once only.applyCookies
in class AbstractServerHttpResponse
protected org.reactivestreams.Processor<? super org.reactivestreams.Publisher<? extends DataBuffer>,Void> createBodyFlushProcessor()
AbstractListenerServerHttpResponse
Processor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output. Called from
AbstractListenerServerHttpResponse.writeAndFlushWithInternal(Publisher)
.createBodyFlushProcessor
in class AbstractListenerServerHttpResponse
protected int writeToOutputStream(DataBuffer dataBuffer) throws IOException
ServletOutputStream.isReady()
returns "true"
and the readable bytes in the DataBuffer is greater than 0.IOException