com.sun.grizzly.async
Interface AsyncQueueReader

All Known Implementing Classes:
AbstractAsyncQueueReader, TCPAsyncQueueReader, UDPAsyncQueueReader

public interface AsyncQueueReader

Author:
Alexey Stashok

Method Summary
 void close()
          Close AsyncQueueReader and release its resources
 AsyncQueue.AsyncQueueEntry getAsyncQueue(SelectionKey key)
          Gets ready asynchronous queue elements to be read from the SelectableChannel, associated with the given SelectionKey
 boolean isReady(SelectionKey key)
          Checks whether AsyncQueueReader is registered for the SelectableChannel, associated with the given SelectionKey
 void onClose(SelectableChannel channel)
          Callback method, which should be called by SelectorHandler to notify, that given SelectableChannel is going to be closed, so related data could be released from AsyncQueueReader
 void onRead(SelectionKey key)
          Callback method, which should be called by SelectorHandler to notify, that SelectableChannel, associated with the given SelectableChannel has ready data for reading.
 Future<AsyncQueueReadUnit> read(SelectionKey key, ByteBuffer buffer, AsyncReadCallbackHandler callbackHandler)
           
 Future<AsyncQueueReadUnit> read(SelectionKey key, ByteBuffer buffer, AsyncReadCallbackHandler callbackHandler, AsyncReadCondition condition)
           
 Future<AsyncQueueReadUnit> read(SelectionKey key, ByteBuffer buffer, AsyncReadCallbackHandler callbackHandler, AsyncReadCondition condition, AsyncQueueDataProcessor readPostProcessor)
           
 

Method Detail

read

Future<AsyncQueueReadUnit> read(SelectionKey key,
                                ByteBuffer buffer,
                                AsyncReadCallbackHandler callbackHandler)
                                throws IOException
Throws:
IOException

read

Future<AsyncQueueReadUnit> read(SelectionKey key,
                                ByteBuffer buffer,
                                AsyncReadCallbackHandler callbackHandler,
                                AsyncReadCondition condition)
                                throws IOException
Throws:
IOException

read

Future<AsyncQueueReadUnit> read(SelectionKey key,
                                ByteBuffer buffer,
                                AsyncReadCallbackHandler callbackHandler,
                                AsyncReadCondition condition,
                                AsyncQueueDataProcessor readPostProcessor)
                                throws IOException
Throws:
IOException

isReady

boolean isReady(SelectionKey key)
Checks whether AsyncQueueReader is registered for the SelectableChannel, associated with the given SelectionKey

Parameters:
key - SelectionKey associated with SelectableChannel
Returns:
true, if there is ready data. False otherwise.

getAsyncQueue

AsyncQueue.AsyncQueueEntry getAsyncQueue(SelectionKey key)
Gets ready asynchronous queue elements to be read from the SelectableChannel, associated with the given SelectionKey

Parameters:
key - SelectionKey associated with SelectableChannel
Returns:
ready asynchronous queue elements to be read to the SelectableChannel, associated with the given SelectionKey/

onRead

void onRead(SelectionKey key)
            throws IOException
Callback method, which should be called by SelectorHandler to notify, that SelectableChannel, associated with the given SelectableChannel has ready data for reading.

Parameters:
key - SelectionKey associated with SelectableChannel
Throws:
java.io.IOException
IOException

onClose

void onClose(SelectableChannel channel)
Callback method, which should be called by SelectorHandler to notify, that given SelectableChannel is going to be closed, so related data could be released from AsyncQueueReader

Parameters:
{@link - SelectableChannel}
Throws:
IOException

close

void close()
Close AsyncQueueReader and release its resources



Copyright © 2012 Oracle Corporation. All Rights Reserved.