nl.pbemengine.engine.ng.base.webserver
Class WebServer

java.lang.Object
  extended by java.lang.Thread
      extended by nl.pbemengine.engine.ng.base.webserver.WebServer
All Implemented Interfaces:
java.lang.Runnable

public class WebServer
extends java.lang.Thread

Miniature Webserver implementation, this class is the main thread for the webserver, accepting connections and relaying them to ConnectionHandler classes.

Author:
Jeroen Steenbeeke

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
 
Constructor Summary
WebServer(WebserverCallback callback)
          Creates a new instance of WebServer
 
Method Summary
 WebRepository getRepository()
          Get the repository tied to this server
 void handlerDone()
          Called by HTTPRequestHandlers after they have finished their work.
 boolean isTerminating()
          Check if the server is already terminating
 void run()
          Main thread execution method
 void terminate()
          Terminates the Webserver thread
 
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
 

Constructor Detail

WebServer

public WebServer(WebserverCallback callback)
Creates a new instance of WebServer

Parameters:
callback - The callback interface for the webserver
Method Detail

run

public void run()
Main thread execution method

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

getRepository

public WebRepository getRepository()
Get the repository tied to this server

Returns:
A PageRepository object

handlerDone

public void handlerDone()
Called by HTTPRequestHandlers after they have finished their work.


isTerminating

public boolean isTerminating()
Check if the server is already terminating

Returns:
true if the server is terminating, false otherwise

terminate

public void terminate()
Terminates the Webserver thread



Copyright © 2008. All Rights Reserved.