XNIO API 2.0.0.GA

org.jboss.xnio.channels
Interface Configurable

All Known Subinterfaces:
AcceptingServer<A,T,C>, BoundChannel<A>, BoundServer<A,T>, CloseableChannel, ConnectedChannel<A>, ConnectedStreamChannel<A>, DatagramChannel<A>, LocalChannel, LocalServer, MessageChannel, MultipointDatagramChannel<A>, MultipointMessageChannel<A>, MultipointReadableMessageChannel<A>, MultipointWritableMessageChannel<A>, ReadableAllocatedMessageChannel, ReadableMessageChannel, SslChannel, SslTcpChannel, StreamChannel, StreamSinkChannel, StreamSourceChannel, SuspendableChannel, SuspendableReadChannel, SuspendableWriteChannel, TcpChannel, TcpServer, UdpChannel, UdpServer, WritableMessageChannel

public interface Configurable

A channel that has parameters that may be configured while the channel is open.


Method Summary
<T> T
getOption(Option<T> option)
          Get the value of a channel option.
<T> Configurable
setOption(Option<T> option, T value)
          Set an option for this channel.
 boolean supportsOption(Option<?> option)
          Determine whether an option is supported on this channel.
 

Method Detail

supportsOption

boolean supportsOption(Option<?> option)
Determine whether an option is supported on this channel.

Parameters:
option - the option
Returns:
true if it is supported

getOption

<T> T getOption(Option<T> option)
            throws java.io.IOException
Get the value of a channel option.

Type Parameters:
T - the type of the option value
Parameters:
option - the option to get
Returns:
the value of the option, or null if it is not set
Throws:
java.io.IOException - if an I/O error occurred when reading the option

setOption

<T> Configurable setOption(Option<T> option,
                           T value)
                       throws java.lang.IllegalArgumentException,
                              java.io.IOException
Set an option for this channel. Unsupported options are ignored.

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:
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

XNIO API 2.0.0.GA

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