public class HealthCheckServlet
extends javax.servlet.http.HttpServlet
HealthCheckRegistry
and prints the results as a text/plain
entity. Only responds to GET
requests.
If the servlet context has an attribute named
com.yammer.metrics.reporting.HealthCheckServlet.registry
which is a
HealthCheckRegistry
instance, HealthCheckServlet
will use it instead of
HealthChecks
.Modifier and Type | Field and Description |
---|---|
static String |
REGISTRY_ATTRIBUTE
The attribute name of the
HealthCheckRegistry instance in the servlet context. |
Constructor and Description |
---|
HealthCheckServlet()
Creates a new
HealthCheckServlet with the default HealthCheckRegistry . |
HealthCheckServlet(HealthCheckRegistry registry)
Creates a new
HealthCheckServlet with the given HealthCheckRegistry . |
Modifier and Type | Method and Description |
---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
init(javax.servlet.ServletConfig config) |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
public static final String REGISTRY_ATTRIBUTE
HealthCheckRegistry
instance in the servlet context.public HealthCheckServlet(HealthCheckRegistry registry)
HealthCheckServlet
with the given HealthCheckRegistry
.registry
- a HealthCheckRegistry
public HealthCheckServlet()
HealthCheckServlet
with the default HealthCheckRegistry
.public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
Copyright © 2014. All Rights Reserved.