javatools.thread
Class NetworkServer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javatools.thread.NetworkServer
All Implemented Interfaces:
java.lang.Runnable, Server

public class NetworkServer
extends java.lang.Thread
implements Server


Field Summary
protected  java.lang.Exception exception
           
protected  boolean keepGoing
           
protected  java.io.PrintStream log
           
protected  ThreadPool pool
           
protected  int port
           
protected  java.lang.Class requestProcessorCls
           
protected  java.net.ServerSocket ss
           
protected  int timeout
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NetworkServer()
           
NetworkServer(java.lang.Class requestProcessorCls)
           
NetworkServer(java.lang.String requestProcessor)
           
 
Method Summary
 java.lang.Exception getException()
           
 int getPort()
           
 NetworkRequestHandler getRequestHandler(java.net.Socket socket)
           
 void go()
           
(package private)  void loadProps()
           
protected  void log(java.lang.String s)
           
static void main(java.lang.String[] a)
           
protected  void p(java.lang.String s)
           
 void run()
           
 void setPort(int port)
           
 void shutdown()
          Shutdown this server thread.
 
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

pool

protected ThreadPool pool

exception

protected java.lang.Exception exception

requestProcessorCls

protected java.lang.Class requestProcessorCls

log

protected java.io.PrintStream log

keepGoing

protected boolean keepGoing

ss

protected java.net.ServerSocket ss

timeout

protected int timeout

port

protected int port
Constructor Detail

NetworkServer

public NetworkServer()

NetworkServer

public NetworkServer(java.lang.String requestProcessor)
              throws java.lang.ClassNotFoundException

NetworkServer

public NetworkServer(java.lang.Class requestProcessorCls)
Method Detail

main

public static void main(java.lang.String[] a)
                 throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException

p

protected void p(java.lang.String s)

log

protected void log(java.lang.String s)

loadProps

void loadProps()

getRequestHandler

public NetworkRequestHandler getRequestHandler(java.net.Socket socket)

run

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

go

public void go()
        throws java.io.IOException
java.io.IOException

shutdown

public void shutdown()
Description copied from interface: Server
Shutdown this server thread.

Specified by:
shutdown in interface Server

getPort

public int getPort()

setPort

public void setPort(int port)

getException

public java.lang.Exception getException()