Class AssembledChannel

java.lang.Object
org.xnio.channels.AssembledChannel
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, InterruptibleChannel, CloseableChannel, Configurable
Direct Known Subclasses:
AssembledConnectedChannel

public class AssembledChannel extends Object implements CloseableChannel
A closeable view over a read and write side of a suspendable channel.
Author:
David M. Lloyd
  • Constructor Details

  • Method Details

    • getCloseSetter

      public ChannelListener.Setter<? extends CloseableChannel> getCloseSetter()
      Description copied from interface: CloseableChannel
      Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.
      Specified by:
      getCloseSetter in interface CloseableChannel
      Returns:
      the setter
    • getWorker

      public XnioWorker getWorker()
      Description copied from interface: CloseableChannel
      Get the worker for this channel.
      Specified by:
      getWorker in interface CloseableChannel
      Returns:
      the worker
    • getIoThread

      public XnioIoThread getIoThread()
      Description copied from interface: CloseableChannel
      Get the I/O thread associated with this channel.
      Specified by:
      getIoThread in interface CloseableChannel
      Returns:
      the I/O thread associated with this channel
    • close

      public void close() throws IOException
      Description copied from interface: CloseableChannel
      Close this channel. When a channel is closed, its close listener is invoked. Invoking this method more than once has no additional effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Channel
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface CloseableChannel
      Specified by:
      close in interface InterruptibleChannel
      Throws:
      IOException - if the close failed
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface Channel
    • supportsOption

      public boolean supportsOption(Option<?> option)
      Description copied from interface: Configurable
      Determine whether an option is supported on this channel.
      Specified by:
      supportsOption in interface Configurable
      Parameters:
      option - the option
      Returns:
      true if it is supported
    • getOption

      public <T> T getOption(Option<T> option) throws 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, or null if it is not set
      Throws:
      IOException - if an I/O error occurred when reading the option
    • setOption

      public <T> T setOption(Option<T> option, T value) throws IllegalArgumentException, IOException
      Description copied from interface: Configurable
      Set an option for this channel. Unsupported options are ignored.
      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:
      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