org.glassfish.grizzly.asyncqueue
Interface AsyncQueue

All Known Subinterfaces:
AsyncQueueReader<L>, AsyncQueueWriter<L>
All Known Implementing Classes:
AbstractNIOAsyncQueueReader, AbstractNIOAsyncQueueWriter, TCPNIOAsyncQueueReader, TCPNIOAsyncQueueWriter, UDPNIOAsyncQueueReader, UDPNIOAsyncQueueWriter

public interface AsyncQueue

Common interface for AsyncQueue processors.

Author:
Alexey Stashok

Method Summary
 void close()
          Close AsyncQueueProcessor and release associated resources
 boolean isReady(Connection connection)
          Checks whether there is ready data in AsyncQueue, associated with the Connection.
 void onClose(Connection connection)
          Callback method, which is called, when Connection has been closed, to let processor release a connection associated resources.
 boolean processAsync(Context context)
          Callback method, which is called async.
 

Method Detail

isReady

boolean isReady(Connection connection)
Checks whether there is ready data in AsyncQueue, associated with the Connection.

Parameters:
connection - Connection
Returns:
true, if there is ready data, or false otherwise.

processAsync

boolean processAsync(Context context)
                     throws java.io.IOException
Callback method, which is called async. to process ready AsyncQueue, which are associated with the given Connection

Parameters:
context - Context
Returns:
true, if there are pending elements to be processed, or false otherwise.
Throws:
java.io.IOException

onClose

void onClose(Connection connection)
Callback method, which is called, when Connection has been closed, to let processor release a connection associated resources.

Parameters:
connection - Connection
Throws:
java.io.IOException

close

void close()
Close AsyncQueueProcessor and release associated resources



Copyright © 2011 Oracle Corpration. All Rights Reserved.