galaxy.server
Class ListenerThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--galaxy.server.ServerCreationThread
              |
              +--galaxy.server.ListenerThread
All Implemented Interfaces:
java.lang.Runnable

public class ListenerThread
extends ServerCreationThread

This thread accepts clients connections and creates server threads to handle the client requests ("server per client connection" model). It also manages connections to outgoing brokers.


Fields inherited from class galaxy.server.ServerCreationThread
CLIENT, in, isRunning, LISTENER, mainServer, out, thread, threadType, tooManyServers
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ListenerThread(MainServer mainServer)
          Constructor
 
Method Summary
protected  boolean listenerHasPort()
          Tests if this listener has acquired a port.
 void run()
          This is the thread's main routine.
 
Methods inherited from class galaxy.server.ServerCreationThread
createServer, isRunning, logErrorMessage, logErrorMessage, logErrorMessage, logErrorMessage, logMessage, logMessage, logWarningMessage, logWarningMessage, startServer, stopThread
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListenerThread

public ListenerThread(MainServer mainServer)
Constructor
Parameters:
mainServer - the MainServer that created this listener
Method Detail

listenerHasPort

protected boolean listenerHasPort()
Tests if this listener has acquired a port.
Returns:
true if this listener has a port, false otherwise

run

public void run()
This is the thread's main routine. It attempts to create a listener on a port. It then loops forever, until interrupted by ServerCreationThread.stopThread, accepting client connections and creating servers to serve the clients.
Overrides:
run in class ServerCreationThread