com.sun.grizzly.http
Class SocketChannelOutputBuffer.AsyncWriteCallbackHandlerImpl
java.lang.Object
com.sun.grizzly.http.SocketChannelOutputBuffer.AsyncWriteCallbackHandlerImpl
- All Implemented Interfaces:
- AsyncWriteCallbackHandler
- Direct Known Subclasses:
- SSLOutputBuffer.AsyncWriteCallbackHandlerImpl
- Enclosing class:
- SocketChannelOutputBuffer
protected static class SocketChannelOutputBuffer.AsyncWriteCallbackHandlerImpl
- extends Object
- implements AsyncWriteCallbackHandler
AsyncWriteCallbackHandler
implementation, which is responsible
for returning cloned ByteBuffers to the pool
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SocketChannelOutputBuffer.AsyncWriteCallbackHandlerImpl
protected SocketChannelOutputBuffer.AsyncWriteCallbackHandlerImpl()
onWriteCompleted
public void onWriteCompleted(SelectionKey key,
AsyncQueueWriteUnit writtenRecord)
- Description copied from interface:
AsyncWriteCallbackHandler
- Method will be called by
AsyncQueueWriter
, if
whole ByteBuffer
data was written to the
SelectableChannel
, associated with SelectionKey
- Specified by:
onWriteCompleted
in interface AsyncWriteCallbackHandler
- Parameters:
key
- SelectionKey
, associated with output
SelectableChannel
writtenRecord
- AsyncWriteQueueRecord
, which was successfuly
written
onException
public void onException(Exception exception,
SelectionKey key,
ByteBuffer buffer,
Queue<AsyncQueueWriteUnit> remainingQueue)
- Description copied from interface:
AsyncWriteCallbackHandler
- Method will be called by
AsyncQueueWriter
, if
error occured when writing ByteBuffer
to the
SelectableChannel
, associated with SelectionKey
- Specified by:
onException
in interface AsyncWriteCallbackHandler
- Parameters:
exception
- occurred Exception
key
- SelectionKey
, associated with output
SelectableChannel
buffer
- ByteBuffer
, which data was failed to be writtenremainingQueue
- queue of write records which were not written yet at the
moment, when exception occured
releaseAsyncWriteUnit
protected boolean releaseAsyncWriteUnit(AsyncQueueWriteUnit unit)
returnBuffer
protected boolean returnBuffer(ByteBuffer buffer)
Copyright © 2012 Oracle Corporation. All Rights Reserved.