cgl.narada.util.webserver
Class WebServer

java.lang.Object
  extended by java.lang.Thread
      extended by cgl.narada.util.webserver.WebServer
All Implemented Interfaces:
Runnable

public class WebServer
extends Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  Properties props
           
protected  boolean s_fileEnabled
           
static Hashtable s_pageMap
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WebServer()
           
 
Method Summary
 void destroy()
          -----------------------------------------------------------------
 void goServer()
          -----------------------------------------------------------------
protected static void log(String s)
          -----------------------------------------------------------------
protected static void p(String s)
          -----------------------------------------------------------------
protected  void printProps()
          -----------------------------------------------------------------
 void run()
          -----------------------------------------------------------------
 void setFileEnabled(boolean enabled)
          ----------------------------------------------------------------- Set whether file access is enabled.
 void setMapping(String file, String page)
          -----------------------------------------------------------------
 void setMapping(String file, WebCGI cgi)
          -----------------------------------------------------------------
 void setPort(int p)
          ----------------------------------------------------------------- Sets the web server port.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, 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

s_pageMap

public static Hashtable s_pageMap

s_fileEnabled

protected boolean s_fileEnabled

props

protected Properties props
Constructor Detail

WebServer

public WebServer()
Method Detail

setMapping

public void setMapping(String file,
                       String page)
-----------------------------------------------------------------


setMapping

public void setMapping(String file,
                       WebCGI cgi)
-----------------------------------------------------------------


setFileEnabled

public void setFileEnabled(boolean enabled)
----------------------------------------------------------------- Set whether file access is enabled. By default is false.


destroy

public void destroy()
-----------------------------------------------------------------

Overrides:
destroy in class Thread

run

public void run()
-----------------------------------------------------------------

Specified by:
run in interface Runnable
Overrides:
run in class Thread

setPort

public void setPort(int p)
----------------------------------------------------------------- Sets the web server port. Default is 8080. needs to be called before goServer.


goServer

public void goServer()
              throws Exception
-----------------------------------------------------------------

Throws:
Exception

p

protected static void p(String s)
-----------------------------------------------------------------


log

protected static void log(String s)
-----------------------------------------------------------------


printProps

protected void printProps()
-----------------------------------------------------------------



For comments and suggestions please send e-mail to The NaradaBrokering Project