Class TaskServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class TaskServlet
    extends javax.servlet.http.HttpServlet
    A servlet which provides access to administrative Tasks. It only responds to POST requests, since most Tasks aren't side effect free, and passes along the query string parameters of the request to the task as a multimap.
    See Also:
    Task, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      TaskServlet​(com.codahale.metrics.MetricRegistry metricRegistry)
      Creates a new TaskServlet.
      TaskServlet​(com.codahale.metrics.MetricRegistry metricRegistry, TaskConfiguration taskConfiguration)
      Creates a new TaskServlet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Task task)  
      protected void doGet​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      protected void doPost​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      Collection<Task> getTasks()  
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
    • Constructor Detail

      • TaskServlet

        public TaskServlet​(com.codahale.metrics.MetricRegistry metricRegistry)
        Creates a new TaskServlet.
      • TaskServlet

        public TaskServlet​(com.codahale.metrics.MetricRegistry metricRegistry,
                           TaskConfiguration taskConfiguration)
        Creates a new TaskServlet.
        Since:
        2.0
    • Method Detail

      • add

        public void add​(Task task)
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             IOException
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest req,
                              javax.servlet.http.HttpServletResponse resp)
                       throws javax.servlet.ServletException,
                              IOException
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException