Interface Configurable

All Known Subinterfaces:
AcceptingChannel<C>, BoundChannel, BoundMultipointMessageChannel, CloseableChannel, ConnectedChannel, ConnectedMessageChannel, ConnectedSslStreamChannel, ConnectedStreamChannel, MessageChannel, MulticastMessageChannel, MultipointMessageChannel, ReadableMessageChannel, ReadableMultipointMessageChannel, SimpleAcceptingChannel<C>, SslChannel, StreamChannel, StreamSinkChannel, StreamSourceChannel, SuspendableAcceptChannel, SuspendableChannel, SuspendableReadChannel, SuspendableWriteChannel, WritableMessageChannel, WritableMultipointMessageChannel
All Known Implementing Classes:
AssembledChannel, AssembledConnectedChannel, AssembledConnectedMessageChannel, AssembledConnectedSslStreamChannel, AssembledConnectedStreamChannel, AssembledMessageChannel, AssembledSslChannel, AssembledStreamChannel, ConduitReadableMessageChannel, ConduitStreamSinkChannel, ConduitStreamSourceChannel, ConduitWritableMessageChannel, Connection, EmptyStreamSourceChannel, FixedLengthStreamSinkChannel, FixedLengthStreamSourceChannel, FramedMessageChannel, JsseSslConnection, JsseSslStreamConnection, MessageConnection, NullStreamSinkChannel, PushBackStreamChannel, SplitStreamSinkChannel, SplitStreamSourceChannel, SslConnection, StreamConnection, TranslatingSuspendableChannel, XnioWorker

public interface Configurable
A channel that has parameters that may be configured while the channel is open.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Configurable
    An empty configurable instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    getOption(Option<T> option)
    Get the value of a channel option.
    <T> T
    setOption(Option<T> option, T value)
    Set an option for this channel.
    boolean
    Determine whether an option is supported on this channel.
  • Field Details

    • EMPTY

      static final Configurable EMPTY
      An empty configurable instance.
  • Method Details

    • 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 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:
      IOException - if an I/O error occurred when reading the option
    • setOption

      <T> T setOption(Option<T> option, T value) throws IllegalArgumentException, 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:
      the previous option value, if any
      Throws:
      IllegalArgumentException - if the value is not acceptable for this option
      IOException - if an I/O error occurred when modifying the option