com.twitter.common.net.http.handlers
Class AbortHandler

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.twitter.common.net.http.handlers.AbortHandler
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class AbortHandler
extends javax.servlet.http.HttpServlet

A servlet that provides a way to remotely terminate the running process immediately.

See Also:
Serialized Form

Field Summary
static String ABORT_HANDLER_KEY
          A @Named binding key for the QuitHandler listener.
 
Constructor Summary
AbortHandler(Runnable abortListener)
          Constructs a new AbortHandler that will notify the given abortListener when the servlet is accessed.
 
Method Summary
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)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABORT_HANDLER_KEY

public static final String ABORT_HANDLER_KEY
A @Named binding key for the QuitHandler listener.

See Also:
Constant Field Values
Constructor Detail

AbortHandler

@Inject
public AbortHandler(Runnable abortListener)
Constructs a new AbortHandler that will notify the given abortListener when the servlet is accessed. It is the responsibility of the listener to initiate an immediate shutdown of the system.

Parameters:
abortListener - Runnable to notify when the servlet is accessed.
Method Detail

doGet

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

doPost

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