Package 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 AsyncQueueCommon interface forAsyncQueueprocessors.- Author:
- Alexey Stashok
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAsyncQueue.AsyncResult
-
Field Summary
Fields Modifier and Type Field Description static StringEXPECTING_MORE_OPTION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close AsyncQueueProcessor and release associated resourcesbooleanisReady(Connection connection)Checks whether there is ready data inAsyncQueue, associated with theConnection.voidonClose(Connection connection)Callback method, which is called, whenConnectionhas been closed, to let processor release a connection associated resources.AsyncQueue.AsyncResultprocessAsync(Context context)Callback method, which is called async.
-
-
-
Field Detail
-
EXPECTING_MORE_OPTION
static final String EXPECTING_MORE_OPTION
-
-
Method Detail
-
isReady
boolean isReady(Connection connection)
Checks whether there is ready data inAsyncQueue, associated with theConnection.- Parameters:
connection-Connection- Returns:
- true, if there is ready data, or false otherwise.
-
processAsync
AsyncQueue.AsyncResult processAsync(Context context)
Callback method, which is called async. to process readyAsyncQueue, which are associated with the givenConnection- Parameters:
context-Context- Returns:
AsyncQueue.AsyncResult, depending on async queue status.
-
onClose
void onClose(Connection connection)
Callback method, which is called, whenConnectionhas been closed, to let processor release a connection associated resources.- Parameters:
connection-Connection
-
close
void close()
Close AsyncQueueProcessor and release associated resources
-
-