public class JettyServer extends javax.servlet.http.HttpServlet implements HTTPServer
| Constructor and Description |
|---|
JettyServer(java.util.Map props) |
| Modifier and Type | Method and Description |
|---|---|
void |
addContext(java.lang.Object obj,
java.lang.String path)
adds the given servlet at the given path to the context
|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
finalize() |
java.lang.String |
getName()
returns the name of the server
|
void |
join()
joins the thread of the server
|
static void |
main(java.lang.String[] args) |
void |
setService(java.lang.String path,
java.util.Map props,
Service service)
It creates the servlet with the given property map and sets the service
on the servlet.
|
void |
start()
starts the server with the given service
|
void |
stop()
stops the server
|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, servicepublic void start()
throws java.lang.Exception
HTTPServerstart in interface HTTPServerjava.lang.Exceptionpublic void stop()
throws java.lang.Exception
HTTPServerstop in interface HTTPServerjava.lang.Exceptionpublic void join()
throws java.lang.InterruptedException
HTTPServerjoin in interface HTTPServerjava.lang.InterruptedExceptionpublic void setService(java.lang.String path,
java.util.Map props,
Service service)
setService in interface HTTPServerpublic void addContext(java.lang.Object obj,
java.lang.String path)
addContext in interface HTTPServerpublic void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionjava.io.IOExceptionpublic java.lang.String getName()
HTTPServergetName in interface HTTPServerprotected void finalize()
finalize in class java.lang.Objectpublic static void main(java.lang.String[] args)