disciple.connections
Class TcpConnectionServer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--disciple.connections.TcpConnectionServer
All Implemented Interfaces:
ConnectionServer, java.lang.Runnable

public class TcpConnectionServer
extends java.lang.Thread
implements ConnectionServer


Field Summary
protected  Controller controller_
           
protected  int priorityLevels_
           
protected  boolean shutDown_
           
protected  java.net.ServerSocket socket_
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TcpConnectionServer(Controller controller, int priorityLevels, int port)
           
 
Method Summary
 Controller getController()
           
 void run()
          The body of the server thread.
 void setController(Controller controller)
           
 void shutDown()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, 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
 

Field Detail

controller_

protected Controller controller_

priorityLevels_

protected int priorityLevels_

socket_

protected java.net.ServerSocket socket_

shutDown_

protected boolean shutDown_
Constructor Detail

TcpConnectionServer

public TcpConnectionServer(Controller controller,
                           int priorityLevels,
                           int port)
                    throws java.io.IOException
Since:
Disciple v3.0
Rose:
3D08E67B00AF
Method Detail

shutDown

public void shutDown()
Specified by:
shutDown in interface ConnectionServer
Since:
Disciple v3.0

setController

public void setController(Controller controller)
Specified by:
setController in interface ConnectionServer
Parameters:
controller -
Since:
Disciple v3.0
Rose:
3D08E67B00CD

getController

public Controller getController()
Specified by:
getController in interface ConnectionServer
Returns:
Controller
Since:
Disciple v3.0
Rose:
3D08E67B00FF

run

public void run()
The body of the server thread. Loops until shut down, listening for and accepting connections from clients. For each connection, create a Connection object to handle communication through the new Socket. When a new connection is created, add it to the Controller.

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


Copyright (c) 2003 Rutgers, The State University of New Jersey