com.trendrr.oss.networking
Class SelectorThread

java.lang.Object
  extended by com.trendrr.oss.networking.SelectorThread
All Implemented Interfaces:
java.lang.Runnable

public class SelectorThread
extends java.lang.Object
implements java.lang.Runnable

Author:
Dustin Norlander

Constructor Summary
SelectorThread()
           
 
Method Summary
 void register(SocketChannelWrapper wrapper)
           
 void registerChange(SocketChannelWrapper wrapper)
          registers that something has changed with the wrapper (read or writes waiting, or disconnect).
static SelectorThread registerChannel(SocketChannelWrapper wrapper)
           
 void run()
           
 void unregister(SocketChannelWrapper wrapper)
          unregisters the wrapper with this selector thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectorThread

public SelectorThread()
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

registerChannel

public static SelectorThread registerChannel(SocketChannelWrapper wrapper)
                                      throws java.io.IOException
Throws:
java.io.IOException

register

public void register(SocketChannelWrapper wrapper)
              throws java.io.IOException
Throws:
java.io.IOException

registerChange

public void registerChange(SocketChannelWrapper wrapper)
registers that something has changed with the wrapper (read or writes waiting, or disconnect).

Parameters:
wrapper -

run

public void run()
Specified by:
run in interface java.lang.Runnable

unregister

public void unregister(SocketChannelWrapper wrapper)
unregisters the wrapper with this selector thread. it is unnecessary to call this if the wrapper.close() method is invoked.