| java.lang.Object org.apache.commons.httpclient.server.SimpleHttpServer
All known Subclasses: org.apache.commons.httpclient.server.SimpleProxy,
SimpleHttpServer | public class SimpleHttpServer implements Runnable(Code) | | A simple, but extensible HTTP server, mostly for testing purposes.
author: Christian Kohlschuetter author: Oleg Kalnichevski |
SimpleHttpServer | public SimpleHttpServer() throws IOException(Code) | | Creates a new HTTP server instance, using an arbitrary free TCP port
throws: IOException - if anything goes wrong during initialization |
SimpleHttpServer | public SimpleHttpServer(SimpleSocketFactory socketfactory, int port) throws IOException(Code) | | Creates a new HTTP server instance, using the specified socket
factory and the TCP port
Parameters: port - Desired TCP port throws: IOException - if anything goes wrong during initialization |
SimpleHttpServer | public SimpleHttpServer(int port) throws IOException(Code) | | Creates a new HTTP server instance, using the specified TCP port
Parameters: port - Desired TCP port throws: IOException - if anything goes wrong during initialization |
destroy | public synchronized void destroy()(Code) | | Stops this HTTP server instance.
|
getLocalAddress | public String getLocalAddress()(Code) | | Returns the IP address that this HTTP server instance is bound to.
String representation of the IP address or null if not running |
getLocalPort | public int getLocalPort()(Code) | | Returns the TCP port that this HTTP server instance is bound to.
TCP port, or -1 if not running |
getRequestHandler | public HttpRequestHandler getRequestHandler()(Code) | | Returns the currently used HttpRequestHandler by this SimpleHttpServer
The used HttpRequestHandler, or null. |
isRunning | public boolean isRunning()(Code) | | Checks if this HTTP server instance is running.
true/false |
setRequestHandler | public void setRequestHandler(HttpRequestHandler rh)(Code) | | Sets the HttpRequestHandler to be used for this SimpleHttpServer.
Parameters: rh - Request handler to be used, or null to disable. |
|
|