Top Description Fields Methods
org.xnio.channels

public Interface Configurable

Known Direct Subinterfaces
org.xnio.channels.ReadableMessageChannel, org.xnio.channels.WritableMessageChannel, org.xnio.channels.CloseableChannel
Known Direct Implementers
org.xnio.XnioWorker
Imports
java.io.IOException, org.xnio.Option

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

Field Summary

Modifier and TypeField and Description
public static final Configurable
EMPTY

An empty configurable instance.

Method Summary

Modifier and TypeMethod and Description
public <
the type of the option value
T
>
T

Returns:

the value of the option, or null if it is not set
getOption
(Option<T>
the option to get
option
)

Get the value of a channel option.

public <
the type of the option value
T
>
T

Returns:

the previous option value, if any
setOption
(Option<T>
the option to set
option
,
T
the value of the option to set
value
)

Set an option for this channel.

public boolean

Returns:

true if it is supported
supportsOption
(Option<?>
the option
option
)

Determine whether an option is supported on this channel.

Field Detail

EMPTYback to summary
public static final Configurable EMPTY

An empty configurable instance.

Method Detail

getOptionback to summary
public <T> T getOption(Option<T> option) throws IOException

Get the value of a channel option.

Parameters
<T>
the type of the option value
option:Option<T>

the option to get

Returns:T

the value of the option, or null if it is not set

Exceptions
IOException:
if an I/O error occurred when reading the option
setOptionback to summary
public <T> T setOption(Option<T> option, T value) throws IllegalArgumentException, IOException

Set an option for this channel. Unsupported options are ignored.

Parameters
<T>
the type of the option value
option:Option<T>

the option to set

value:T

the value of the option to set

Returns:T

the previous option value, if any

Exceptions
IllegalArgumentException:
if the value is not acceptable for this option
IOException:
if an I/O error occurred when modifying the option
supportsOptionback to summary
public boolean supportsOption(Option<?> option)

Determine whether an option is supported on this channel.

Parameters
option:Option<?>

the option

Returns:boolean

true if it is supported