public class HTTPServer
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static HTTPServer |
get(HTTPBinding binding,
boolean keepAlive,
java.util.List supportedMethods,
boolean create)
Returns a HTTP server for the given address and port.
|
HTTPBinding |
getBinding() |
IPAddress |
getIPAddress() |
int |
getPort() |
void |
register(java.lang.String path,
ContentType type,
HTTPRequestHandler handler)
Registers a relative HTTP path and a content type with a given
HTTPRequestHandler. |
void |
register(java.lang.String path,
HTTPRequestHandler handler)
Registers a relative HTTP path with a given
HTTPRequestHandler. |
void |
setChunkedInAllowed(boolean chunkedInAllowed) |
static void |
stopALLServers(java.lang.String comManId) |
HTTPRequestHandler |
unregister(HTTPBinding binding,
java.lang.String path)
Removes registration of a relative HTTP path for a
HTTPRequestHandler. |
HTTPRequestHandler |
unregister(HTTPBinding binding,
java.lang.String path,
ContentType type)
Removes registration of a relative HTTP path and content type for a HTTP handler.
|
HTTPRequestHandler |
unregister(java.lang.String path)
Removes registration of a relative HTTP path for a
HTTPRequestHandler, but will not
shut down the HTTP server when the last handler was removed. |
protected void |
unregisterAllDeadTimeouts() |
protected void |
unregisterAllTimeouts() |
void |
unregisterAndStop() |
public static void stopALLServers(java.lang.String comManId)
public static HTTPServer get(HTTPBinding binding, boolean keepAlive, java.util.List supportedMethods, boolean create) throws java.io.IOException
The HTTP server is started at creation time.
binding - the address of the HTTP server.keepAlive - java.io.IOException - Throws exception if the port could not be opened at the given address.public void unregisterAndStop()
throws java.io.IOException
java.io.IOExceptionprotected void unregisterAllTimeouts()
protected void unregisterAllDeadTimeouts()
public void register(java.lang.String path,
HTTPRequestHandler handler)
throws java.io.IOException
HTTPRequestHandler.path - the HTTP path.handler - the HTTP handler which should handle the request.java.io.IOExceptionpublic void register(java.lang.String path,
ContentType type,
HTTPRequestHandler handler)
throws java.io.IOException
HTTPRequestHandler.path - the HTTP path.type - the HTTP content type.handler - the HTTP handler which should handle the request.java.io.IOExceptionpublic HTTPRequestHandler unregister(java.lang.String path)
HTTPRequestHandler, but will not
shut down the HTTP server when the last handler was removed.path - public HTTPRequestHandler unregister(HTTPBinding binding, java.lang.String path)
HTTPRequestHandler.path - the HTTP path.HTTPRequestHandler.public HTTPRequestHandler unregister(HTTPBinding binding, java.lang.String path, ContentType type)
path - the HTTP path.type - the HTTP content type.HTTPRequestHandler.public int getPort()
public IPAddress getIPAddress()
public HTTPBinding getBinding()
public void setChunkedInAllowed(boolean chunkedInAllowed)