XNIO API 3.0.7.GA

org.xnio.channels
Interface WritableMultipointMessageChannel

All Superinterfaces:
Channel, Closeable, CloseableChannel, Configurable, InterruptibleChannel, SuspendableWriteChannel
All Known Subinterfaces:
BoundMultipointMessageChannel, MulticastMessageChannel, MultipointMessageChannel

public interface WritableMultipointMessageChannel
extends SuspendableWriteChannel

The writable side of a multipoint message channel.

See Also:
MultipointMessageChannel

Method Summary
 ChannelListener.Setter<? extends WritableMultipointMessageChannel> getCloseSetter()
          Get the setter which can be used to change the close listener for this channel.
 ChannelListener.Setter<? extends WritableMultipointMessageChannel> getWriteSetter()
          Get the setter which can be used to change the write listener for this channel.
 boolean sendTo(SocketAddress target, ByteBuffer buffer)
          Send a buffer to a destination.
 boolean sendTo(SocketAddress target, ByteBuffer[] buffers)
          Send a message with data from multiple buffers to a destination.
 boolean sendTo(SocketAddress target, ByteBuffer[] buffers, int offset, int length)
          Send a message with data from multiple buffers to a destination.
 
Methods inherited from interface org.xnio.channels.SuspendableWriteChannel
awaitWritable, awaitWritable, close, flush, getWriteThread, isWriteResumed, resumeWrites, shutdownWrites, suspendWrites, wakeupWrites
 
Methods inherited from interface org.xnio.channels.CloseableChannel
getWorker
 
Methods inherited from interface java.nio.channels.Channel
isOpen
 
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
 

Method Detail

sendTo

boolean sendTo(SocketAddress target,
               ByteBuffer buffer)
               throws IOException
Send a buffer to a destination.

Parameters:
target - the destination
buffer - the data to send
Returns:
true if the message was sent, or false if the channel is not currently writable
Throws:
IOException - if an I/O error occurs

sendTo

boolean sendTo(SocketAddress target,
               ByteBuffer[] buffers)
               throws IOException
Send a message with data from multiple buffers to a destination.

Parameters:
target - the destination
buffers - the data to send
Returns:
true if the message was sent, or false if the channel is not currently writable
Throws:
IOException - if an I/O error occurs

sendTo

boolean sendTo(SocketAddress target,
               ByteBuffer[] buffers,
               int offset,
               int length)
               throws IOException
Send a message with data from multiple buffers to a destination.

Parameters:
target - the destination
buffers - the data to send
offset - the offset into the buffers array
length - the number of buffers to read from
Returns:
true if the message was sent, or false if the channel is not currently writable
Throws:
IOException - if an I/O error occurs

getWriteSetter

ChannelListener.Setter<? extends WritableMultipointMessageChannel> getWriteSetter()
Get the setter which can be used to change the write listener for this channel. When the listener is called, additional notifications are automatically suspended.

Specified by:
getWriteSetter in interface SuspendableWriteChannel
Returns:
the setter

getCloseSetter

ChannelListener.Setter<? extends WritableMultipointMessageChannel> getCloseSetter()
Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.

Specified by:
getCloseSetter in interface CloseableChannel
Specified by:
getCloseSetter in interface SuspendableWriteChannel
Returns:
the setter

XNIO API 3.0.7.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.