com.sun.grizzly.asyncqueue
Interface AsyncQueueProcessor

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

public interface AsyncQueueProcessor
extends Processor

Common interface for AsyncQueue processors.

Author:
Alexey Stashok

Field Summary
static int NOT_REGISTER_KEY
           
 
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.
 void processAsync(Connection connection)
          Callback method, which is called async.
 
Methods inherited from interface com.sun.grizzly.Processor
afterProcess, beforeProcess, context, isInterested, process, setInterested
 

Field Detail

NOT_REGISTER_KEY

static final int NOT_REGISTER_KEY
See Also:
Constant Field Values
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

void processAsync(Connection connection)
                  throws IOException
Callback method, which is called async. to process ready AsyncQueue, which are associated with the given Connection

Parameters:
connection - Connection
Throws:
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:
IOException

close

void close()
Close AsyncQueueProcessor and release associated resources



Copyright © 2009 SUN Microsystems. All Rights Reserved.