org.glassfish.grizzly
Interface Writer<L>

All Known Subinterfaces:
AsyncQueueWriter<L>
All Known Implementing Classes:
AbstractNIOAsyncQueueWriter, AbstractWriter, TCPNIOAsyncQueueWriter, TCPNIOTemporarySelectorWriter, TemporarySelectorWriter, UDPNIOAsyncQueueWriter, UDPNIOTemporarySelectorWriter

public interface Writer<L>

Implementations of this interface are able to write data from a Buffer to Connection. There are two basic Writer implementations in Grizzly: AsyncQueueWriter, TemporarySelectorWriter.

Author:
Alexey Stashok

Method Summary
 GrizzlyFuture<WriteResult<WritableMessage,L>> write(Connection connection, L dstAddress, WritableMessage message)
          Method writes the WritableMessage to the specific address.
 void write(Connection connection, L dstAddress, WritableMessage message, CompletionHandler<WriteResult<WritableMessage,L>> completionHandler)
          Method writes the WritableMessage to the specific address.
 void write(Connection connection, L dstAddress, WritableMessage message, CompletionHandler<WriteResult<WritableMessage,L>> completionHandler, PushBackHandler pushBackHandler)
          Method writes the WritableMessage to the specific address.
 GrizzlyFuture<WriteResult<WritableMessage,L>> write(Connection connection, WritableMessage message)
          Method writes the WritableMessage.
 void write(Connection connection, WritableMessage message, CompletionHandler<WriteResult<WritableMessage,L>> completionHandler)
          Method writes the WritableMessage.
 

Method Detail

write

GrizzlyFuture<WriteResult<WritableMessage,L>> write(Connection connection,
                                                    WritableMessage message)
                                                    throws IOException
Method writes the WritableMessage.

Parameters:
connection - the Connection to write to
message - the WritableMessage, from which the data will be written
Returns:
Future, using which it's possible to check the result
Throws:
IOException

write

void write(Connection connection,
           WritableMessage message,
           CompletionHandler<WriteResult<WritableMessage,L>> completionHandler)
Method writes the WritableMessage.

Parameters:
connection - the Connection to write to
message - the WritableMessage, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed

write

GrizzlyFuture<WriteResult<WritableMessage,L>> write(Connection connection,
                                                    L dstAddress,
                                                    WritableMessage message)
Method writes the WritableMessage to the specific address.

Parameters:
connection - the Connection to write to
dstAddress - the destination address the WritableMessage will be sent to
message - the WritableMessage, from which the data will be written
Returns:
Future, using which it's possible to check the result

write

void write(Connection connection,
           L dstAddress,
           WritableMessage message,
           CompletionHandler<WriteResult<WritableMessage,L>> completionHandler)
Method writes the WritableMessage to the specific address.

Parameters:
connection - the Connection to write to
dstAddress - the destination address the WritableMessage will be sent to
message - the WritableMessage, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed

write

void write(Connection connection,
           L dstAddress,
           WritableMessage message,
           CompletionHandler<WriteResult<WritableMessage,L>> completionHandler,
           PushBackHandler pushBackHandler)
Method writes the WritableMessage to the specific address.

Parameters:
connection - the Connection to write to
dstAddress - the destination address the WritableMessage will be sent to
message - the WritableMessage, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed
pushBackHandler - PushBackHandler, which will be notified if message was accepted by transport write queue or refused


Copyright © 2013 Oracle Corporation. All Rights Reserved.