rabbit.io
Class SelectorRegistrator

java.lang.Object
  extended by rabbit.io.SelectorRegistrator

public class SelectorRegistrator
extends Object

A class to handle selector registrations.

Author:
Robert Olofsson

Constructor Summary
SelectorRegistrator()
           
 
Method Summary
static SelectionKey register(Logger logger, SelectableChannel channel, Selector selector, int ops, SocketHandler sh)
           
static SelectionKey register(Logger logger, SelectableChannel channel, Selector selector, int ops, SocketHandler sh, long when)
           
static void unregister(Selector selector, SelectionKey sk, SocketHandler sh, String reason)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectorRegistrator

public SelectorRegistrator()
Method Detail

register

public static SelectionKey register(Logger logger,
                                    SelectableChannel channel,
                                    Selector selector,
                                    int ops,
                                    SocketHandler sh)
                             throws ClosedChannelException
Throws:
ClosedChannelException

register

public static SelectionKey register(Logger logger,
                                    SelectableChannel channel,
                                    Selector selector,
                                    int ops,
                                    SocketHandler sh,
                                    long when)
                             throws ClosedChannelException
Throws:
ClosedChannelException

unregister

public static void unregister(Selector selector,
                              SelectionKey sk,
                              SocketHandler sh,
                              String reason)