org.apache.coyote.http11

Interface OutputFilter

public interface OutputFilter extends OutputBuffer

Output filter.

Author: Remy Maucherat

Method Summary
intdoWrite(ByteChunk chunk, Response unused)
Write some bytes.
longend()
End the current request.
ByteChunkgetEncodingName()
Get the name of the encoding handled by this filter.
voidrecycle()
Make the filter ready to process the next request.
voidsetBuffer(OutputBuffer buffer)
Set the next buffer in the filter pipeline.
voidsetResponse(Response response)
Some filters need additional parameters from the response.

Method Detail

doWrite

public int doWrite(ByteChunk chunk, Response unused)
Write some bytes.

Returns: number of bytes written by the filter

end

public long end()
End the current request. It is acceptable to write extra bytes using buffer.doWrite during the execution of this method.

Returns: Should return 0 unless the filter does some content length delimitation, in which case the number is the amount of extra bytes or missing bytes, which would indicate an error. Note: It is recommended that extra bytes be swallowed by the filter.

getEncodingName

public ByteChunk getEncodingName()
Get the name of the encoding handled by this filter.

recycle

public void recycle()
Make the filter ready to process the next request.

setBuffer

public void setBuffer(OutputBuffer buffer)
Set the next buffer in the filter pipeline.

setResponse

public void setResponse(Response response)
Some filters need additional parameters from the response. All the necessary reading can occur in that method, as this method is called after the response header processing is complete.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.