Class BufferedResponseHandler

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
All Implemented Interfaces:
Handler, Handler.Container, Handler.Singleton, Request.Handler, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.util.thread.Invocable

public class BufferedResponseHandler extends ConditionalHandler.Abstract

A Handler that can apply a mechanism to buffer the entire response content until the output is closed. This allows the commit to be delayed until the response is complete and thus headers and response status can be changed while writing the body.

Note that the decision to buffer is influenced by the headers and status at the first write, and thus subsequent changes to those headers will not influence the decision to buffer or not.

Note also that the size of the buffer can be controlled by setting the BUFFER_SIZE_ATTRIBUTE_NAME request attribute to an integer; in the absence of such header, the HttpConfiguration.getOutputBufferSize() config setting is used, while the maximum aggregation size can be controlled by setting the MAX_AGGREGATION_SIZE_ATTRIBUTE_NAME request attribute to an integer, in the absence of such header, the HttpConfiguration.getOutputAggregationSize() config setting is used.