|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ka2ddo.yaac.webserver.HttpServer
public class HttpServer
This class implements a very simple HTTP server. It spawns a HttpConnectionThread instance for each incoming connection request.
HttpConnectionThread| Constructor Summary | |
|---|---|
HttpServer(int listenPort,
int refreshRateInSec,
java.util.Map<java.lang.String,PathHandler> pathToHandlerMap)
Create a HttpServer instance on the specified listening port. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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 objects| Method Detail |
|---|
public 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 refreshes
java.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()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||