java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
net.i2p.addressbook.servlet.Servlet
- All Implemented Interfaces:
Serializable, Servlet, ServletConfig
A wrapper for addressbook to allow it to be started as a web application. This was a GenericServlet, we make it an HttpServlet solely to provide a simple page to display status.
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longPinned for serialized-form compatibility.private ThreadThe worker thread, left out of the serialized formConstructor Summary
ConstructorsConstructorDescriptionServlet()A servlet with no addressbook thread yet; init() starts the daemon, so construction alone leaves nothing running.Method Summary
All MethodsModifier and TypeMethodDescriptionvoiddestroy()Destroy the servlet and halt the addressbook daemon thread.voidinit(ServletConfig config) Initialize the servlet and start the addressbook daemon thread.voidservice(HttpServletRequest request, HttpServletResponse response) Handle service requests.Methods inherited from class HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
Field Details
serialVersionUID
private static final long serialVersionUIDPinned for serialized-form compatibility.- See Also:
thread
The worker thread, left out of the serialized form
Constructor Details
Servlet
public Servlet()A servlet with no addressbook thread yet; init() starts the daemon, so construction alone leaves nothing running.
Method Details
service
Handle service requests. Outputs a simple status page.- Overrides:
servicein classHttpServlet- Parameters:
request- the HTTP requestresponse- the HTTP response- Throws:
IOException- if an I/O error occurs
init
Initialize the servlet and start the addressbook daemon thread.- Specified by:
initin interfaceServlet- Overrides:
initin classGenericServlet- Parameters:
config- the servlet configuration
destroy
public void destroy()Destroy the servlet and halt the addressbook daemon thread.- Specified by:
destroyin interfaceServlet- Overrides:
destroyin classGenericServlet