org.jboss.xnio.nio
Class BioUdpServer

java.lang.Object
  extended by org.jboss.xnio.nio.BioUdpServer
All Implemented Interfaces:
java.io.Closeable, BoundServer<java.net.SocketAddress,UdpChannel>, Configurable

public final class BioUdpServer
extends java.lang.Object
implements BoundServer<java.net.SocketAddress,UdpChannel>


Field Summary
protected static java.util.Set<ChannelOption<?>> OPTIONS
           
 
Method Summary
 IoFuture<UdpChannel> bind(java.net.SocketAddress address)
          Add a binding.
 void close()
           
 java.util.Collection<UdpChannel> getChannels()
          Get the channels representing the individual bound servers.
<T> T
getOption(ChannelOption<T> option)
          Get the value of a channel option.
 java.util.Set<ChannelOption<?>> getOptions()
          Get the options that may be set on this channel.
<T> Configurable
setOption(ChannelOption<T> option, T value)
          Set an option for this channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTIONS

protected static final java.util.Set<ChannelOption<?>> OPTIONS
Method Detail

getOption

public <T> T getOption(ChannelOption<T> option)
            throws UnsupportedOptionException,
                   java.io.IOException
Description copied from interface: Configurable
Get the value of a channel option.

Specified by:
getOption in interface Configurable
Type Parameters:
T - the type of the option value
Parameters:
option - the option to get
Returns:
the value of the option
Throws:
UnsupportedOptionException - if the option is not supported by this channel
java.io.IOException - if an I/O error occurred when reading the option

getOptions

public java.util.Set<ChannelOption<?>> getOptions()
Description copied from interface: Configurable
Get the options that may be set on this channel.

Specified by:
getOptions in interface Configurable
Returns:
an unmodifiable set of options

setOption

public <T> Configurable setOption(ChannelOption<T> option,
                                  T value)
                       throws java.lang.IllegalArgumentException,
                              java.io.IOException
Description copied from interface: Configurable
Set an option for this channel.

Specified by:
setOption in interface Configurable
Type Parameters:
T - the type of the option value
Parameters:
option - the option to set
value - the value of the option to set
Returns:
this channel
Throws:
UnsupportedOptionException - if the option is not supported by this channel
java.lang.IllegalArgumentException - if the value is not acceptable for this option
java.io.IOException - if an I/O error occured when modifying the option

getChannels

public java.util.Collection<UdpChannel> getChannels()
Description copied from interface: BoundServer
Get the channels representing the individual bound servers. The collection is a snapshot view of the bound channels; modifications to the collection are not allowed. However the channels within the collection are live references to the bindings that exist at the time this method is called; these channels may be closed to unbind the channel.

Specified by:
getChannels in interface BoundServer<java.net.SocketAddress,UdpChannel>
Returns:
the channels

bind

public IoFuture<UdpChannel> bind(java.net.SocketAddress address)
Description copied from interface: BoundServer
Add a binding. The returned channel may be used to close the binding.

Specified by:
bind in interface BoundServer<java.net.SocketAddress,UdpChannel>
Parameters:
address - the address to bind to
Returns:
a future channel representing the binding

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException