com.sun.grizzly.async
Interface AsyncWriteCallbackHandler

All Known Implementing Classes:
SocketChannelOutputBuffer.AsyncWriteCallbackHandlerImpl, SSLOutputBuffer.AsyncWriteCallbackHandlerImpl

public interface AsyncWriteCallbackHandler

Callback handler interface, used by AsyncQueueWriter to notify custom code either about completion of specific ByteBuffer writing or about IO problem, which occured when writing ByteBuffer

Author:
Alexey Stashok

Method Summary
 void onException(Exception exception, SelectionKey key, ByteBuffer buffer, Queue<AsyncQueueWriteUnit> remainingQueue)
          Method will be called by AsyncQueueWriter, if error occured when writing ByteBuffer to the SelectableChannel, associated with SelectionKey
 void onWriteCompleted(SelectionKey key, AsyncQueueWriteUnit writtenRecord)
          Method will be called by AsyncQueueWriter, if whole ByteBuffer data was written to the SelectableChannel, associated with SelectionKey
 

Method Detail

onWriteCompleted

void onWriteCompleted(SelectionKey key,
                      AsyncQueueWriteUnit writtenRecord)
Method will be called by AsyncQueueWriter, if whole ByteBuffer data was written to the SelectableChannel, associated with SelectionKey

Parameters:
key - SelectionKey, associated with output SelectableChannel
writtenRecord - AsyncWriteQueueRecord, which was successfuly written

onException

void onException(Exception exception,
                 SelectionKey key,
                 ByteBuffer buffer,
                 Queue<AsyncQueueWriteUnit> remainingQueue)
Method will be called by AsyncQueueWriter, if error occured when writing ByteBuffer to the SelectableChannel, associated with SelectionKey

Parameters:
exception - occurred Exception
key - SelectionKey, associated with output SelectableChannel
buffer - ByteBuffer, which data was failed to be written
remainingQueue - queue of write records which were not written yet at the moment, when exception occured


Copyright © 2012 Oracle Corporation. All Rights Reserved.