com.sun.grizzly.async
Interface AsyncReadCondition


public interface AsyncReadCondition

Interface represents condition, which will be checked when AsyncQueueReader was able to read new portion of data from SelectableChannel, which is associated with a SelectionKey. Custom condition code could decide whether read data is enough to call AsyncReadCallbackHandler.onReadCompleted() or more data is expected.

Author:
Alexey Stashok

Method Summary
 boolean checkAsyncReadCompleted(java.nio.channels.SelectionKey key, java.net.SocketAddress srcAddress, java.nio.ByteBuffer buffer)
          Method checks, whether data, which was read to the ByteBuffer, is read completely, or custom code expects more data.
 

Method Detail

checkAsyncReadCompleted

boolean checkAsyncReadCompleted(java.nio.channels.SelectionKey key,
                                java.net.SocketAddress srcAddress,
                                java.nio.ByteBuffer buffer)
Method checks, whether data, which was read to the ByteBuffer, is read completely, or custom code expects more data.

Parameters:
key - SelectionKey
srcAddress - SocketAddress remote address data was read from
buffer - ByteBuffer data was read to
Returns:
true, if data reading is completed, false - if mora data is expected


Copyright © 2012 Oracle Corporation. All Rights Reserved.