Apache Tomcat 7.0.4

org.apache.coyote.http11
Class InternalNioOutputBuffer

java.lang.Object
  extended by org.apache.coyote.http11.AbstractOutputBuffer
      extended by org.apache.coyote.http11.InternalNioOutputBuffer
All Implemented Interfaces:
OutputBuffer

public class InternalNioOutputBuffer
extends AbstractOutputBuffer

Output buffer.

Author:
Remy Maucherat, Filip Hanik

Nested Class Summary
protected  class InternalNioOutputBuffer.SocketOutputBuffer
          This class is an output buffer which will write data to an output stream.
 
Field Summary
protected  MutableInteger lastWrite
          Number of bytes last written
protected  NioSelectorPool pool
          Selector pool, for blocking reads and blocking writes
protected  NioChannel socket
          Underlying socket.
 
Fields inherited from class org.apache.coyote.http11.AbstractOutputBuffer
activeFilters, buf, committed, filterLibrary, finished, headers, lastActiveFilter, outputStreamOutputBuffer, pos, response, sm
 
Constructor Summary
InternalNioOutputBuffer(Response response)
          Default constructor.
InternalNioOutputBuffer(Response response, int headerBufferSize)
          Alternate constructor.
 
Method Summary
protected  void commit()
          Commit the response.
 void endRequest()
          End request.
 void flush()
          Flush the response.
protected  void flushBuffer()
          Callback to write data from the buffer.
 NioSelectorPool getSelectorPool()
           
 NioChannel getSocket()
          Get the underlying socket input stream.
 boolean isWritable()
           
 void recycle()
          Recycle the output buffer.
 void sendAck()
          Send an acknowledgment.
 void setSelectorPool(NioSelectorPool pool)
           
 void setSocket(NioChannel socket)
          Set the underlying socket.
 
Methods inherited from class org.apache.coyote.http11.AbstractOutputBuffer
addActiveFilter, addFilter, clearFilters, doWrite, endHeaders, getFilters, nextRequest, reset, sendHeader, sendHeader, sendHeader, sendStatus, write, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastWrite

protected MutableInteger lastWrite
Number of bytes last written


socket

protected NioChannel socket
Underlying socket.


pool

protected NioSelectorPool pool
Selector pool, for blocking reads and blocking writes

Constructor Detail

InternalNioOutputBuffer

public InternalNioOutputBuffer(Response response)
Default constructor.


InternalNioOutputBuffer

public InternalNioOutputBuffer(Response response,
                               int headerBufferSize)
Alternate constructor.

Method Detail

setSocket

public void setSocket(NioChannel socket)
Set the underlying socket.


getSocket

public NioChannel getSocket()
Get the underlying socket input stream.


setSelectorPool

public void setSelectorPool(NioSelectorPool pool)

getSelectorPool

public NioSelectorPool getSelectorPool()

flush

public void flush()
           throws IOException
Flush the response.

Overrides:
flush in class AbstractOutputBuffer
Throws:
IOException - an underlying I/O error occurred

recycle

public void recycle()
Recycle the output buffer. This should be called when closing the connection.

Overrides:
recycle in class AbstractOutputBuffer

endRequest

public void endRequest()
                throws IOException
End request.

Overrides:
endRequest in class AbstractOutputBuffer
Throws:
IOException - an underlying I/O error occurred

isWritable

public boolean isWritable()

sendAck

public void sendAck()
             throws IOException
Send an acknowledgment.

Specified by:
sendAck in class AbstractOutputBuffer
Throws:
IOException

commit

protected void commit()
               throws IOException
Commit the response.

Specified by:
commit in class AbstractOutputBuffer
Throws:
IOException - an underlying I/O error occurred

flushBuffer

protected void flushBuffer()
                    throws IOException
Callback to write data from the buffer.

Throws:
IOException

Apache Tomcat 7.0.4

Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.