org.jboss.xnio.nio
Class AbstractConfigurable

java.lang.Object
  extended by org.jboss.xnio.nio.AbstractConfigurable
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
BioUdpServerFactory, NioTcpAcceptorFactory, NioTcpConnectorFactory, NioTcpServerFactory, NioUdpServerFactory

public abstract class AbstractConfigurable
extends java.lang.Object
implements Configurable


Constructor Summary
protected AbstractConfigurable(java.util.Set<ChannelOption<?>> validOptions)
           
 
Method Summary
<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> AbstractConfigurable
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
 

Constructor Detail

AbstractConfigurable

protected AbstractConfigurable(java.util.Set<ChannelOption<?>> validOptions)
Method Detail

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

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

setOption

public <T> AbstractConfigurable 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