public class HTTPServer extends WebServer
Modifier and Type | Field and Description |
---|---|
boolean |
debug |
boolean |
info |
int |
lineBuilderSize |
int |
numReadThread |
int |
numWriteThread |
int |
readBufferSize |
long |
timeOut |
Constructor and Description |
---|
HTTPServer(java.net.InetSocketAddress address) |
Modifier and Type | Method and Description |
---|---|
SelectionHandler |
getAcceptHandler() |
HTTPContext |
getContext(HTTPRequest request) |
void |
onTimeOut(java.nio.channels.SelectionKey selectionKey) |
void |
putContextGenerator(java.lang.String path,
IContextGenerator generator) |
void |
removeContextGenerator(java.lang.String path) |
void |
startServer() |
void |
stopServer() |
public boolean debug
public boolean info
public int readBufferSize
public int lineBuilderSize
public int numReadThread
public int numWriteThread
public long timeOut
public HTTPContext getContext(HTTPRequest request) throws java.net.MalformedURLException
java.net.MalformedURLException
public void putContextGenerator(java.lang.String path, IContextGenerator generator)
path
- should contain the host name(for example:
www.example.com/path/to/file.html)generator
- public void removeContextGenerator(java.lang.String path)
public void startServer()
startServer
in class WebServer
public void stopServer()
stopServer
in class WebServer
public void onTimeOut(java.nio.channels.SelectionKey selectionKey)
public SelectionHandler getAcceptHandler()
getAcceptHandler
in class WebServer
SelectionKey.OP_ACCEPT
.