public class ServletServerHttpResponse extends AbstractListenerServerHttpResponse
ServerHttpResponse
to the Servlet HttpServletResponse
.Modifier and Type | Class and Description |
---|---|
private class |
ServletServerHttpResponse.ResponseAsyncListener |
private class |
ServletServerHttpResponse.ResponseBodyFlushProcessor |
private class |
ServletServerHttpResponse.ResponseBodyProcessor |
private class |
ServletServerHttpResponse.ResponseBodyWriteListener |
Modifier and Type | Field and Description |
---|---|
private ServletServerHttpResponse.ResponseBodyFlushProcessor |
bodyFlushProcessor |
private ServletServerHttpResponse.ResponseBodyProcessor |
bodyProcessor |
private int |
bufferSize |
private boolean |
flushOnNext |
private HttpServletResponse |
response |
Constructor and Description |
---|
ServletServerHttpResponse(HttpServletResponse response,
AsyncContext asyncContext,
DataBufferFactory bufferFactory,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyCookies()
Implement this method to add cookies from
AbstractServerHttpResponse.getHeaders() to the
underlying response. |
protected void |
applyHeaders()
Implement this method to apply header changes from
AbstractServerHttpResponse.getHeaders()
to the underlying response. |
protected void |
applyStatusCode()
Implement this method to write the status code to the underlying response.
|
protected <any> |
createBodyFlushProcessor()
Abstract template method to create a
Processor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output. |
private void |
flush() |
HttpServletResponse |
getServletResponse() |
protected int |
writeToOutputStream(DataBuffer dataBuffer)
Write the DataBuffer to the response body OutputStream.
|
writeAndFlushWithInternal, writeWithInternal
beforeCommit, bufferFactory, doCommit, doCommit, encodeUrl, getCookies, getHeaders, getStatusCode, isCommitted, registerUrlEncoder, setComplete, setStatusCode, writeAndFlushWith, writeWith
private final HttpServletResponse response
private final int bufferSize
private volatile ServletServerHttpResponse.ResponseBodyFlushProcessor bodyFlushProcessor
private volatile ServletServerHttpResponse.ResponseBodyProcessor bodyProcessor
private volatile boolean flushOnNext
public ServletServerHttpResponse(HttpServletResponse response, AsyncContext asyncContext, DataBufferFactory bufferFactory, int bufferSize) throws java.io.IOException
java.io.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 <any> createBodyFlushProcessor()
AbstractListenerServerHttpResponse
Processor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output. Called from
#writeAndFlushWithInternal(Publisher)
.createBodyFlushProcessor
in class AbstractListenerServerHttpResponse
protected int writeToOutputStream(DataBuffer dataBuffer) throws java.io.IOException
ServletOutputStream#isReady()
returns "true"
and the readable bytes in the DataBuffer is greater than 0.java.io.IOException
private void flush() throws java.io.IOException
java.io.IOException