org.glassfish.grizzly
Interface Writable<L>

All Known Subinterfaces:
Connection<L>
All Known Implementing Classes:
NIOConnection, TCPNIOConnection, TCPNIOServerConnection, UDPNIOConnection, UDPNIOServerConnection

public interface Writable<L>

Implementations of this interface are able to write data from a Buffer. Grizzly Connection extends Writable.

Author:
Alexey Stashok

Method Summary
<M> GrizzlyFuture<WriteResult<M,L>>
write(L dstAddress, M message, CompletionHandler<WriteResult<M,L>> completionHandler)
          Method writes the buffer to the specific address.
<M> GrizzlyFuture<WriteResult<M,L>>
write(M message)
          Method writes the buffer.
<M> GrizzlyFuture<WriteResult<M,L>>
write(M message, CompletionHandler<WriteResult<M,L>> completionHandler)
          Method writes the buffer.
 

Method Detail

write

<M> GrizzlyFuture<WriteResult<M,L>> write(M message)
                                      throws java.io.IOException
Method writes the buffer.

Parameters:
message - the buffer, from which the data will be written
Returns:
Future, using which it's possible to check the result
Throws:
java.io.IOException

write

<M> GrizzlyFuture<WriteResult<M,L>> write(M message,
                                          CompletionHandler<WriteResult<M,L>> completionHandler)
                                      throws java.io.IOException
Method writes the buffer.

Parameters:
message - the buffer, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed
Returns:
Future, using which it's possible to check the result
Throws:
java.io.IOException

write

<M> GrizzlyFuture<WriteResult<M,L>> write(L dstAddress,
                                          M message,
                                          CompletionHandler<WriteResult<M,L>> completionHandler)
                                      throws java.io.IOException
Method writes the buffer to the specific address.

Parameters:
dstAddress - the destination address the buffer will be sent to
message - the buffer, from which the data will be written
completionHandler - CompletionHandler, which will get notified, when write will be completed
Returns:
Future, using which it's possible to check the result
Throws:
java.io.IOException


Copyright © 2011 Oracle Corpration. All Rights Reserved.