org.glassfish.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
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 todstAddress - the destination address the message will be
sent tobuffer - the message, from which the data will be writtencompletionHandler - CompletionHandler,
which will get notified, when write will be completedinterceptor - 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.