com.sun.enterprise.web.connector.grizzly.async
Class AsynchronousOutputBuffer

java.lang.Object
  extended by org.apache.coyote.http11.InternalOutputBuffer
      extended by com.sun.enterprise.web.connector.grizzly.SocketChannelOutputBuffer
          extended by com.sun.enterprise.web.connector.grizzly.async.AsynchronousOutputBuffer
All Implemented Interfaces:
OutputBuffer, ByteChunk.ByteOutputChannel

public class AsynchronousOutputBuffer
extends SocketChannelOutputBuffer

Thread-Safe SocketChannelOutputBuffer used when Comet is used.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.coyote.http11.InternalOutputBuffer
InternalOutputBuffer.OutputStreamOutputBuffer
 
Field Summary
 
Fields inherited from class com.sun.enterprise.web.connector.grizzly.SocketChannelOutputBuffer
socketChannel
 
Fields inherited from class org.apache.coyote.http11.InternalOutputBuffer
activeFilters, buf, committed, filterLibrary, finished, headers, lastActiveFilter, log, outputStream, outputStreamOutputBuffer, pos, response, sm, socketBuffer, useSocketBuffer
 
Constructor Summary
AsynchronousOutputBuffer(Response response, int headerBufferSize, boolean useSocketBuffer)
          Alternate constructor.
 
Method Summary
 void flush()
          Flush the buffered bytes,
 void flushBuffer()
          Writes bytes to the underlying socketChannel.
 void flushChannel(ByteBuffer bb)
          Flush the buffer by looping until the ByteBuffer is empty
 void realWriteBytes(byte[] cbuf, int off, int len)
          Callback to write data from the buffer.
 
Methods inherited from class com.sun.enterprise.web.connector.grizzly.SocketChannelOutputBuffer
endRequest, getChannel, getMaxBufferedBytes, recycle, sendAck, setChannel, setMaxBufferedBytes
 
Methods inherited from class org.apache.coyote.http11.InternalOutputBuffer
addActiveFilter, addFilter, clearFilters, commit, doWrite, endHeaders, getFilters, getOutputStream, nextRequest, reset, sendHeader, sendHeader, sendHeader, sendStatus, setOutputStream, setSocketBuffer, write, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousOutputBuffer

public AsynchronousOutputBuffer(Response response,
                                int headerBufferSize,
                                boolean useSocketBuffer)
Alternate constructor.

Method Detail

realWriteBytes

public void realWriteBytes(byte[] cbuf,
                           int off,
                           int len)
                    throws IOException
Description copied from class: SocketChannelOutputBuffer
Callback to write data from the buffer.

Specified by:
realWriteBytes in interface ByteChunk.ByteOutputChannel
Overrides:
realWriteBytes in class SocketChannelOutputBuffer
Throws:
IOException

flushChannel

public void flushChannel(ByteBuffer bb)
                  throws IOException
Description copied from class: SocketChannelOutputBuffer
Flush the buffer by looping until the ByteBuffer is empty

Overrides:
flushChannel in class SocketChannelOutputBuffer
Parameters:
bb - the ByteBuffer to write.
Throws:
IOException

flush

public void flush()
           throws IOException
Description copied from class: SocketChannelOutputBuffer
Flush the buffered bytes,

Overrides:
flush in class SocketChannelOutputBuffer
Throws:
IOException - an undelying I/O error occured

flushBuffer

public void flushBuffer()
                 throws IOException
Description copied from class: SocketChannelOutputBuffer
Writes bytes to the underlying socketChannel.

Overrides:
flushBuffer in class SocketChannelOutputBuffer
Throws:
IOException


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.