com.philemonworks.selfdiagnose
Class SelfDiagnoseServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.philemonworks.selfdiagnose.SelfDiagnoseServlet
- All Implemented Interfaces:
- Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public class SelfDiagnoseServlet
- extends javax.servlet.http.HttpServlet
SelfDiagnoseServlet is a server component that can run and report on all registered diagnostic tasks.
Queries:
- reload, trigger reloading the configuration [selfdiagnose.xml] found on the classpath.
Request parameters:
- html, if true then the report is presented by a HTML table. Otherwise the plain log text is returned.
- xml, if true then the report is available in XML format for processing by other applications (such as dashboards)
- Author:
- emicklei
- See Also:
- Serialized Form
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)
Accept the configuration that is POSTed by the request. |
static javax.servlet.http.HttpServletRequest |
getCurrentRequest()
|
static javax.servlet.http.HttpSession |
getCurrentSession()
|
DiagnoseRunReporter |
getReporter(String format)
|
static String |
getWebApplicationName()
|
void |
run(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Run all diagnostic tasks |
static void |
setCurrentRequest(javax.servlet.http.HttpServletRequest request)
Store the current request in a threadlocal variable. |
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 |
SelfDiagnoseServlet
public SelfDiagnoseServlet()
getCurrentSession
public static javax.servlet.http.HttpSession getCurrentSession()
- Returns:
- HttpSession the current session
setCurrentRequest
public static void setCurrentRequest(javax.servlet.http.HttpServletRequest request)
- Store the current request in a threadlocal variable.
- Parameters:
request
- HttpServletRequest
getCurrentRequest
public static javax.servlet.http.HttpServletRequest getCurrentRequest()
- Returns:
- HttpServletRequest the current request
getWebApplicationName
public static String getWebApplicationName()
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
run
public void run(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
- Run all diagnostic tasks
- Parameters:
req
- : HttpServletRequestresp
- : HttpServletResponse
- Throws:
javax.servlet.ServletException
IOException
getReporter
public DiagnoseRunReporter getReporter(String format)
doPost
protected void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
- Accept the configuration that is POSTed by the request.
- Overrides:
doPost
in class javax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
Copyright © 2012. All Rights Reserved.