Class HealthServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
alpine.server.servlets.HealthServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class HealthServlet extends jakarta.servlet.http.HttpServlet
A HttpServlet exposing health information, following the MicroProfile Health specification.

Health checks can be added by implementing the HealthCheck interface, and registering implementations with the global HealthCheckRegistry instance.

HealthCheck implementations must be annotated with either Liveness, Readiness, Startup, or any combination of the same. Checks without any of those annotations will be ignored.

Since:
2.3.0
See Also:
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    void
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HealthServlet

      public HealthServlet()
  • Method Details

    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class jakarta.servlet.GenericServlet
      Throws:
      jakarta.servlet.ServletException
    • doGet

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