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, service
public void start() throws java.lang.Exception
HTTPServer
start
in interface HTTPServer
java.lang.Exception
public void stop() throws java.lang.Exception
HTTPServer
stop
in interface HTTPServer
java.lang.Exception
public void join() throws java.lang.InterruptedException
HTTPServer
join
in interface HTTPServer
java.lang.InterruptedException
public void setService(java.lang.String path, java.util.Map props, Service service)
setService
in interface HTTPServer
public void addContext(java.lang.Object obj, java.lang.String path)
addContext
in interface HTTPServer
public 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.HttpServlet
javax.servlet.ServletException
java.io.IOException
public java.lang.String getName()
HTTPServer
getName
in interface HTTPServer
protected void finalize()
finalize
in class java.lang.Object
public static void main(java.lang.String[] args)