org.apache.mina.transport.nio

## Class NioSelectorLoop

- java.lang.Object
- - org.apache.mina.transport.nio.NioSelectorLoop

- All Implemented Interfaces:
    SelectorLoop

      public class NioSelectorLoop
      extends Object
      implements SelectorLoop

  This class holds a Selector and handle all the incoming events for the sessions registered on this selector.ALl the events will be processed by some dedicated thread, taken from a pool. It will loop forever, untill the instance is stopped.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NioSelectorLoop(String prefix)` Creates an instance of the SelectorLoop.
    `NioSelectorLoop(String prefix, int index)` Creates an instance of the SelectorLoop.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `modifyRegistration(boolean accept, boolean read, boolean write, SelectorListener listener, SelectableChannel channel, boolean wakeup)`
    `void` | `register(boolean accept, boolean connect, boolean read, boolean write, SelectorListener listener, SelectableChannel channel, RegistrationCallback callback)` Register a channel on a Selector, for some events.
    `void` | `unregister(SelectorListener listener, SelectableChannel channel)`
    `void` | `wakeup()` Wake up the selector

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NioSelectorLoop

          public NioSelectorLoop(String prefix)

      Creates an instance of the SelectorLoop.
      Parameters:
        `prefix` -
        `index` -

    - #### NioSelectorLoop

          public NioSelectorLoop(String prefix,
                         int index)

      Creates an instance of the SelectorLoop.
      Parameters:
        `prefix` -
        `index` -

  - ### Method Detail

    - #### register

          public void register(boolean accept,
                      boolean connect,
                      boolean read,
                      boolean write,
                      SelectorListener listener,
                      SelectableChannel channel,
                      RegistrationCallback callback)

      Register a channel on a Selector, for some events. We can register for OP_ACCEPT, OP_READ or OP_WRITE.
      Specified by:
        `register` in interface `SelectorLoop`
      Parameters:
        `accept` - Registers for OP_ACCEPT events
        `connect` - Registers for OP_CONNECT events
        `read` - Registers for OP_READ events
        `write` - Registers for OP_WRITE events
        `listener` - The listener

    - #### modifyRegistration

          public void modifyRegistration(boolean accept,
                                boolean read,
                                boolean write,
                                SelectorListener listener,
                                SelectableChannel channel,
                                boolean wakeup)

      Specified by:
        `modifyRegistration` in interface `SelectorLoop`

    - #### unregister

          public void unregister(SelectorListener listener,
                        SelectableChannel channel)

      Specified by:
        `unregister` in interface `SelectorLoop`

    - #### wakeup

          public void wakeup()

      Description copied from interface: `SelectorLoop`
      Wake up the selector
      Specified by:
        `wakeup` in interface `SelectorLoop`

Copyright © 2009–2013 Apache MINA Project. All rights reserved.