@Handler
    public void onNioRegistration(NioRegistration event)
            throws IOException {
        SelectableChannel channel = event.ioChannel();
        channel.configureBlocking(false);
        SelectionKey key;
        synchronized (selectorGate) {
            selector.wakeup(); // make sure selector isn't blocking
            key = channel.register(
                selector, event.ops(), event.handler());
        }
        event.setResult(new Registration(key));
    }
@ Handler public void onNioRegistration ( NioRegistration event ) throws IOException { SelectableChannel channel = event . ioChannel ( ) ; channel . configureBlocking ( false ) ; SelectionKey key ; synchronized ( selectorGate ) { selector . wakeup ( ) ; key = channel . register ( selector , event . ops ( ) , event . handler ( ) ) ; } event . setResult ( new Registration ( key ) ) ; }
Handle the NIO registration.

@param event the event
@throws IOException Signals that an I/O exception has occurred.