Class ServerChannelContext

java.lang.Object
org.elasticsearch.nio.ChannelContext<java.nio.channels.ServerSocketChannel>
org.elasticsearch.nio.ServerChannelContext

public class ServerChannelContext
extends ChannelContext<java.nio.channels.ServerSocketChannel>
  • Constructor Details

  • Method Details

    • acceptChannels

      public void acceptChannels​(java.util.function.Supplier<NioSelector> selectorSupplier) throws java.io.IOException
      Throws:
      java.io.IOException
    • addBindListener

      public void addBindListener​(java.util.function.BiConsumer<java.lang.Void,​java.lang.Exception> listener)
    • register

      protected void register() throws java.io.IOException
      Overrides:
      register in class ChannelContext<java.nio.channels.ServerSocketChannel>
      Throws:
      java.io.IOException
    • closeChannel

      public void closeChannel()
      Description copied from class: ChannelContext
      Schedules a channel to be closed by the selector event loop with which it is registered. If the channel is open and the state can be transitioned to closed, the close operation will be scheduled with the event loop. Depending on the underlying protocol of the channel, a close operation might simply close the socket channel or may involve reading and writing messages.
      Specified by:
      closeChannel in class ChannelContext<java.nio.channels.ServerSocketChannel>
    • getSelector

      public NioSelector getSelector()
      Specified by:
      getSelector in class ChannelContext<java.nio.channels.ServerSocketChannel>
    • getChannel

      public NioServerSocketChannel getChannel()
      Specified by:
      getChannel in class ChannelContext<java.nio.channels.ServerSocketChannel>
    • accept

      protected static java.nio.channels.SocketChannel accept​(java.nio.channels.ServerSocketChannel serverSocketChannel) throws java.io.IOException
      Throws:
      java.io.IOException