dsto.dfc.test
Class ProtocolServer

java.lang.Object
  extended by java.lang.Thread
      extended by dsto.dfc.test.ProtocolServer
All Implemented Interfaces:
Runnable

public class ProtocolServer
extends Thread

Runs a server on a socket that accepts messages and responds appropriately with the use of an AbstractProtocol instance.

Version:
$Revision$
Author:
WeberD

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean autoNewline
           
protected  Object lock
           
protected  int port
           
protected  AbstractProtocol protocol
           
protected  boolean running
           
protected  ServerSocket serverSocket
           
protected  boolean shuttingDown
           
protected  List spawnedThreads
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ProtocolServer(int aPort, AbstractProtocol aProtocol)
           
 
Method Summary
 void run()
           
 void setAutoNewline(boolean value)
           
 void startServer()
           
 void stopServer()
           
 
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

port

protected int port

running

protected boolean running

lock

protected Object lock

protocol

protected AbstractProtocol protocol

spawnedThreads

protected List spawnedThreads

serverSocket

protected ServerSocket serverSocket

shuttingDown

protected boolean shuttingDown

autoNewline

protected boolean autoNewline
Constructor Detail

ProtocolServer

public ProtocolServer(int aPort,
                      AbstractProtocol aProtocol)
Method Detail

setAutoNewline

public void setAutoNewline(boolean value)

startServer

public void startServer()

stopServer

public void stopServer()
                throws IOException
Throws:
IOException

run

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


Copyright © 2008 Commonwealth of Australia