com.sun.grizzly.asyncqueue
Interface AsyncQueueWriter<L>

All Superinterfaces:
AsyncQueueProcessor, Processor, Writer<L>
All Known Implementing Classes:
AbstractNIOAsyncQueueWriter, TCPNIOAsyncQueueWriter, UDPNIOAsyncQueueWriter

public interface AsyncQueueWriter<L>
extends Writer<L>, AsyncQueueProcessor

The AsyncQueueProcessor, which implements asynchronous write queue.

Author:
Alexey Stashok

Field Summary
 
Fields inherited from interface com.sun.grizzly.asyncqueue.AsyncQueueProcessor
NOT_REGISTER_KEY
 
Method Summary
 Future<WriteResult<Buffer,L>> write(Connection connection, L dstAddress, Buffer buffer, CompletionHandler<WriteResult<Buffer,L>> completionHandler, Interceptor<WriteResult> interceptor, MessageCloner<Buffer> cloner)
          Method writes the Buffer to the specific address.
 
Methods inherited from interface com.sun.grizzly.Writer
write, write, write, write, write, write
 
Methods inherited from interface com.sun.grizzly.asyncqueue.AsyncQueueProcessor
close, isReady, onClose, processAsync
 
Methods inherited from interface com.sun.grizzly.Processor
afterProcess, beforeProcess, context, isInterested, process, setInterested
 

Method Detail

write

Future<WriteResult<Buffer,L>> write(Connection connection,
                                    L dstAddress,
                                    Buffer buffer,
                                    CompletionHandler<WriteResult<Buffer,L>> completionHandler,
                                    Interceptor<WriteResult> interceptor,
                                    MessageCloner<Buffer> cloner)
                                    throws IOException
Method writes the Buffer to the specific address.

Parameters:
connection - the Connection to write to
dstAddress - the destination address the message will be sent to
buffer - the message, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed
interceptor - Interceptor, which will be able to intercept control each time new portion of a data was written from a buffer. The interceptor can decide, whether asynchronous write is completed or not, or provide other processing instructions.
cloner - MessageCloner, which will be invoked by AsyncQueueWriter, if message could not be written to a channel directly and has to be put on a asynchronous queue
Returns:
Future, using which it's possible to check the result
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.