org.glassfish.grizzly.streams
Interface AddressableStreamWriter<A>

All Superinterfaces:
Closeable, StreamWriter
All Known Implementing Classes:
UDPNIOStreamWriter

public interface AddressableStreamWriter<A>
extends StreamWriter

Addressable StreamWriter, which can send data to different destinations.

Author:
Alexey Stashok
See Also:
UDPNIOStreamWriter, AddressableStreamReader

Method Summary
 Future<Integer> flush(A peerAddress, CompletionHandler<Integer> completionHandler)
          Flush data to the specific destination address.
 A getPeerAddress()
          Get the destination address, where the data will be sent on next flush.
 void setPeerAddress(A peerAddress)
          Set the destination address, where the data will be sent on next flush.
 
Methods inherited from interface org.glassfish.grizzly.streams.StreamWriter
close, flush, flush, getBuffer, getBufferSize, getConnection, getTimeout, isBlocking, setBlocking, setBufferSize, setTimeout, writeBoolean, writeBooleanArray, writeBuffer, writeByte, writeByteArray, writeByteArray, writeChar, writeCharArray, writeDouble, writeDoubleArray, writeFloat, writeFloatArray, writeInt, writeIntArray, writeLong, writeLongArray, writeShort, writeShortArray, writeStream
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

getPeerAddress

A getPeerAddress()
Get the destination address, where the data will be sent on next flush.

Returns:
the destination address, where the data will be sent on next flush.

setPeerAddress

void setPeerAddress(A peerAddress)
Set the destination address, where the data will be sent on next flush.

Parameters:
peerAddress - the destination address, where the data will be sent on next flush.

flush

Future<Integer> flush(A peerAddress,
                      CompletionHandler<Integer> completionHandler)
                      throws IOException
Flush data to the specific destination address.

Parameters:
peerAddress - the destination address, where the data will be sent on next flush.
completionHandler - CompletionHandler, which will get updated with the flush operation state.
Returns:
Future, which could be checked to get flush operation state.
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.