edu.neu.ccs.demeterf.http.server
Class ServerThread

java.lang.Object
  extended by java.lang.Thread
      extended by edu.neu.ccs.demeterf.http.server.ServerThread
All Implemented Interfaces:
java.lang.Runnable

public class ServerThread
extends java.lang.Thread

Represents the Dispatch portion of an HTTP Server. Given a Map of Paths to Methods, it is responsible for calling methods when given a specific request.


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
 
Method Summary
 void addServant(java.lang.Thread t)
          Add a Servant Thread to the List
 void removeServant(java.lang.Thread t)
          Remove a Servant Thread from the List
 void run()
          Run!!
static void setVerbose(boolean v)
          Set to true in order to get Output for Server/Dispatch descisions.
 void shutdown()
          Kill the Server listening thread, though workers will continue/complete
 void waitServants()
          Await the completion of all Servant Threads
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setVerbose

public static void setVerbose(boolean v)
Set to true in order to get Output for Server/Dispatch descisions.


run

public void run()
Run!!

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

addServant

public void addServant(java.lang.Thread t)
Add a Servant Thread to the List


removeServant

public void removeServant(java.lang.Thread t)
Remove a Servant Thread from the List


waitServants

public void waitServants()
Await the completion of all Servant Threads


shutdown

public void shutdown()
              throws java.io.IOException
Kill the Server listening thread, though workers will continue/complete

Throws:
java.io.IOException