com.sun.grizzly.async
Interface AsyncWriteCallbackHandler


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 onIOException(IOException ioException, SelectionKey key, ByteBuffer buffer, Queue<AsyncWriteQueueRecord> remainingQueue)
          Method will be called by AsyncQueueWriter, if IO error occured when writing ByteBuffer to the SelectableChannel, associated with SelectionKey
 void onWriteCompleted(SelectionKey key, ByteBuffer buffer)
          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,
                      ByteBuffer buffer)
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
buffer - ByteBuffer, which data was successfully written

onIOException

void onIOException(IOException ioException,
                   SelectionKey key,
                   ByteBuffer buffer,
                   Queue<AsyncWriteQueueRecord> remainingQueue)
Method will be called by AsyncQueueWriter, if IO error occured when writing ByteBuffer to the SelectableChannel, associated with SelectionKey

Parameters:
ioException - occured IOException
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 © 2009 SUN Microsystems. All Rights Reserved.