edu.sdsc.inca
Class Server.ClientDispatcher

java.lang.Object
  extended by java.lang.Thread
      extended by edu.sdsc.inca.Server.ClientDispatcher
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
Server

protected class Server.ClientDispatcher
extends java.lang.Thread

A class that listens on a server socket and adds new client connections to a work queue.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean shutdown
           
protected  java.net.ServerSocket ss
           
protected  WorkQueue<Worker> wq
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Server.ClientDispatcher(java.net.ServerSocket ss, WorkQueue<Worker> wq)
          Constructs a new ClientDispatcher.
 
Method Summary
 boolean isShutdown()
          Returns true iff this thread has been interrupted and clean up is done.
 void run()
          Begin listening to the server socket and queueing client connections.
protected  void setShutdown(boolean shutdown)
           
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

shutdown

protected boolean shutdown

ss

protected java.net.ServerSocket ss

wq

protected WorkQueue<Worker> wq
Constructor Detail

Server.ClientDispatcher

public Server.ClientDispatcher(java.net.ServerSocket ss,
                               WorkQueue<Worker> wq)
Constructs a new ClientDispatcher.

Parameters:
ss - the server socket to listen to
wq - the work queue on which to place new client connections
Method Detail

isShutdown

public boolean isShutdown()
Returns true iff this thread has been interrupted and clean up is done.


run

public void run()
Begin listening to the server socket and queueing client connections.

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

setShutdown

protected void setShutdown(boolean shutdown)