|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--webcore.webserver.WebServer
WebServer listens on a port for HTTP requests and processes them.
The WebServer uses an instance of WebServerSocketFactoryInterface to create listening Sockets. The default factory creates instances of java.net.ServerSocket.
The WebServer uses an instance of WebRequestableFactoryInterface to to process HTTP requests.
Constructor Summary | |
WebServer()
|
Method Summary | |
void |
addWebServerListener(WebServerListener l)
adds a listener to this WebServer |
java.lang.String |
getDocumentBase()
Gets the document base. |
int |
getPort()
returns the port being used |
WebServerSocketFactoryInterface |
getSocketFactory()
returns the current socket factory. |
WebRequestableFactoryInterface |
getWebRequestableFactory()
returns the current web requestable factory. |
boolean |
isTerminated()
determines if the webserver has been terminated |
void |
removeWebServerListener(WebServerListener l)
removes a listener from this WebServer |
void |
run()
called by runThread to start the listening process. |
void |
setDocumentBase(java.lang.String documentBase)
Sets the document base. |
void |
setPort(int p)
Sets the port the webserver will listen on. |
void |
setSocketFactory(WebServerSocketFactoryInterface factory)
The factory is used to create listening sockets for the server. |
void |
setWebRequestableFactory(WebRequestableFactoryInterface factory)
sets the web requestable factory. |
void |
start()
Starts the webserver with the listening Thread being set as not daemon. |
void |
start(boolean daemon)
Start the webserver. |
void |
terminate()
terminates the webserver, the compliment to start() |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WebServer()
Method Detail |
public void start() throws java.io.IOException
java.io.IOException
public void start(boolean daemon) throws java.io.IOException
daemon
- determine if the listening thread should be set as
a daemon thread or not
java.io.IOException
public int getPort()
public void setPort(int p)
public boolean isTerminated()
public void terminate() throws java.io.IOException
java.io.IOException
public WebRequestableFactoryInterface getWebRequestableFactory()
public void setWebRequestableFactory(WebRequestableFactoryInterface factory)
public WebServerSocketFactoryInterface getSocketFactory()
public void setSocketFactory(WebServerSocketFactoryInterface factory)
public void setDocumentBase(java.lang.String documentBase)
public java.lang.String getDocumentBase()
public void run()
run
in interface java.lang.Runnable
public void addWebServerListener(WebServerListener l)
public void removeWebServerListener(WebServerListener l)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |