public class HttpServer
extends java.lang.Object
implements java.lang.Runnable
HttpConnectionThread| Constructor and Description |
|---|
HttpServer(int listenPort,
int refreshRateInSec,
java.util.Map<java.lang.String,PathHandler> pathToHandlerMap)
Create a HttpServer instance on the specified listening port.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getListenPort()
Get the port the mini-webserver is currently listening on.
|
java.util.Iterator<java.lang.String> |
getPathIterator()
Obtain an Iterator across all the pages known to this web server.
|
int |
getRefreshRateInSec()
Get the automatic page refresh rate setting currently sent to browsers.
|
void |
run()
Accept incoming HTTP connection requests and spawn a handler thread for each browser connection.
|
void |
setListenPort(int listenPort)
Change the port number that the mini-webserver should listen on.
|
void |
setRefreshRateInSec(int refreshRateInSec)
Set the automatic page refresh rate setting currently sent to browsers.
|
public HttpServer(int listenPort,
int refreshRateInSec,
java.util.Map<java.lang.String,PathHandler> pathToHandlerMap)
listenPort - TCP port number to accept incoming HTTP requests onrefreshRateInSec - refresh interval in seconds for web pages that do auto-refreshingpathToHandlerMap - map of URL path strings to handler objectspublic void run()
run in interface java.lang.Runnablepublic int getRefreshRateInSec()
public void setRefreshRateInSec(int refreshRateInSec)
throws java.lang.IllegalArgumentException
refreshRateInSec - page refresh rate in seconds between refreshesjava.lang.IllegalArgumentException - if specified refresh rate is shorter than 5 secondspublic int getListenPort()
public void setListenPort(int listenPort)
listenPort - TCP port number for YAAC's internal webserverpublic java.util.Iterator<java.lang.String> getPathIterator()