| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.coyote.http11.InternalNioOutputBuffer
public class InternalNioOutputBuffer
Output buffer.
| Nested Class Summary | |
|---|---|
| protected  class | InternalNioOutputBuffer.SocketOutputBufferThis class is an output buffer which will write data to an output stream. | 
| Field Summary | |
|---|---|
| protected  OutputFilter[] | activeFiltersActive filter (which is actually the top of the pipeline). | 
| protected  byte[] | bufPointer to the current write buffer. | 
| protected  boolean | committedCommitted flag. | 
| protected  OutputFilter[] | filterLibraryFilter library. | 
| protected  boolean | finishedFinished flag. | 
| protected  MimeHeaders | headersHeaders of the associated request. | 
| protected  int | lastActiveFilterIndex of the last active filter. | 
| protected  MutableInteger | lastWriteNumber of bytes last written | 
| protected  OutputBuffer | outputStreamOutputBufferUnderlying output buffer. | 
| protected  NioSelectorPool | poolSelector pool, for blocking reads and blocking writes | 
| protected  int | posPosition in the buffer. | 
| protected  Response | responseAssociated Coyote response. | 
| protected static StringManager | smThe string manager for this package. | 
| protected  NioChannel | socketUnderlying socket. | 
| Constructor Summary | |
|---|---|
| InternalNioOutputBuffer(Response response)Default constructor. | |
| InternalNioOutputBuffer(Response response,
                        int headerBufferSize)Alternate constructor. | |
| Method Summary | |
|---|---|
|  void | addActiveFilter(OutputFilter filter)Add an output filter to the filter library. | 
|  void | addFilter(OutputFilter filter)Add an output filter to the filter library. | 
|  void | clearFilters()Clear filters. | 
| protected  void | commit()Commit the response. | 
|  int | doWrite(ByteChunk chunk,
        Response res)Write the contents of a byte chunk. | 
|  void | endHeaders()End the header block. | 
|  void | endRequest()End request. | 
|  void | flush()Flush the response. | 
| protected  void | flushBuffer()Callback to write data from the buffer. | 
|  OutputFilter[] | getFilters()Get filters. | 
|  NioSelectorPool | getSelectorPool() | 
|  NioChannel | getSocket()Get the underlying socket input stream. | 
|  boolean | isWritable() | 
|  void | nextRequest()End processing of current HTTP request. | 
|  void | recycle()Recycle the output buffer. | 
|  void | reset()Reset current response. | 
|  void | sendAck()Send an acknoledgement. | 
|  void | sendHeader(ByteChunk name,
           ByteChunk value)Send a header. | 
|  void | sendHeader(MessageBytes name,
           MessageBytes value)Send a header. | 
|  void | sendHeader(java.lang.String name,
           java.lang.String value)Send a header. | 
|  void | sendStatus()Send the response status line. | 
|  void | setSelectorPool(NioSelectorPool pool) | 
|  void | setSocket(NioChannel socket)Set the underlying socket. | 
|  void | setSocketBuffer(int socketBufferSize)Set the socket buffer size. | 
|  void | write(byte[] b)This method will write the contents of the specyfied byte buffer to the output stream, without filtering. | 
| protected  void | write(ByteChunk bc)This method will write the contents of the specyfied message bytes buffer to the output stream, without filtering. | 
| protected  void | write(CharChunk cc)This method will write the contents of the specyfied char buffer to the output stream, without filtering. | 
| protected  void | write(int i)This method will print the specified integer to the output stream, without filtering. | 
| protected  void | write(MessageBytes mb)This method will write the contents of the specyfied message bytes buffer to the output stream, without filtering. | 
| protected  void | write(java.lang.String s)This method will write the contents of the specyfied String to the output stream, without filtering. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected static StringManager sm
protected Response response
protected MimeHeaders headers
protected boolean committed
protected boolean finished
protected byte[] buf
protected int pos
protected MutableInteger lastWrite
protected NioChannel socket
protected NioSelectorPool pool
protected OutputBuffer outputStreamOutputBuffer
protected OutputFilter[] filterLibrary
protected OutputFilter[] activeFilters
protected int lastActiveFilter
| Constructor Detail | 
|---|
public InternalNioOutputBuffer(Response response)
public InternalNioOutputBuffer(Response response,
                               int headerBufferSize)
| Method Detail | 
|---|
public void setSocket(NioChannel socket)
public NioChannel getSocket()
public void setSelectorPool(NioSelectorPool pool)
public NioSelectorPool getSelectorPool()
public void setSocketBuffer(int socketBufferSize)
public void addFilter(OutputFilter filter)
public OutputFilter[] getFilters()
public void clearFilters()
public void addActiveFilter(OutputFilter filter)
public void flush()
           throws java.io.IOException
java.io.IOException - an undelying I/O error occuredpublic void reset()
java.lang.IllegalStateException - if the response has already been committedpublic void recycle()
public void nextRequest()
public void endRequest()
                throws java.io.IOException
java.io.IOException - an undelying I/O error occuredpublic boolean isWritable()
public void sendAck()
             throws java.io.IOException
java.io.IOExceptionpublic void sendStatus()
public void sendHeader(MessageBytes name,
                       MessageBytes value)
name - Header namevalue - Header value
public void sendHeader(ByteChunk name,
                       ByteChunk value)
name - Header namevalue - Header value
public void sendHeader(java.lang.String name,
                       java.lang.String value)
name - Header namevalue - Header valuepublic void endHeaders()
public int doWrite(ByteChunk chunk,
                   Response res)
            throws java.io.IOException
doWrite in interface OutputBufferchunk - byte chunkres - used to allow buffers that can be shared by multiple responses.
java.io.IOException - an undelying I/O error occured
protected void commit()
               throws java.io.IOException
java.io.IOException - an undelying I/O error occuredprotected void write(MessageBytes mb)
mb - data to be writtenprotected void write(ByteChunk bc)
bc - data to be writtenprotected void write(CharChunk cc)
cc - data to be writtenpublic void write(byte[] b)
b - data to be writtenprotected void write(java.lang.String s)
s - data to be writtenprotected void write(int i)
i - data to be written
protected void flushBuffer()
                    throws java.io.IOException
java.io.IOException| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||