com.jme3.network.kernel.tcp
Class SelectorKernel.SelectorThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.jme3.network.kernel.tcp.SelectorKernel.SelectorThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
SelectorKernel

protected class SelectorKernel.SelectorThread
extends java.lang.Thread

This class is purposely tucked neatly away because messing with the selector from other threads for any reason is very bad. This is the safest architecture.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SelectorKernel.SelectorThread()
           
 
Method Summary
protected  void accept(java.nio.channels.SelectionKey key)
           
protected  void cancel(NioEndpoint p)
           
protected  void cancel(java.nio.channels.SelectionKey key, java.nio.channels.SocketChannel c)
           
 void close()
           
 void connect()
           
protected  void read(java.nio.channels.SelectionKey key)
           
 void run()
           
protected  void select()
           
protected  void setupSelectorOptions()
           
protected  void wakeupSelector()
           
protected  void write(java.nio.channels.SelectionKey key)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectorKernel.SelectorThread

public SelectorKernel.SelectorThread()
Method Detail

connect

public void connect()
             throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException,
                  java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

wakeupSelector

protected void wakeupSelector()

setupSelectorOptions

protected void setupSelectorOptions()

accept

protected void accept(java.nio.channels.SelectionKey key)
               throws java.io.IOException
Throws:
java.io.IOException

cancel

protected void cancel(NioEndpoint p)
               throws java.io.IOException
Throws:
java.io.IOException

cancel

protected void cancel(java.nio.channels.SelectionKey key,
                      java.nio.channels.SocketChannel c)
               throws java.io.IOException
Throws:
java.io.IOException

read

protected void read(java.nio.channels.SelectionKey key)
             throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.nio.channels.SelectionKey key)
              throws java.io.IOException
Throws:
java.io.IOException

select

protected void select()
               throws java.io.IOException
Throws:
java.io.IOException

run

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