Class AbstractHealthCheck

java.lang.Object
com.codahale.metrics.health.HealthCheck
com.peterphi.std.guice.metrics.health.AbstractHealthCheck
All Implemented Interfaces:
GuiceLifecycleListener
Direct Known Subclasses:
FolderAccessibleCheck

public abstract class AbstractHealthCheck extends com.codahale.metrics.health.HealthCheck implements GuiceLifecycleListener
Abstract parent class for Health Checks. Should be bound as an eager singleton. When created the Health Check will be auto-registered with Guice (this behaviour can be customised by implementing logic in enabled(). If enabled returns false then the Health Check will not be registered with guice)
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.codahale.metrics.health.HealthCheck

    com.codahale.metrics.health.HealthCheck.Result, com.codahale.metrics.health.HealthCheck.ResultBuilder
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    Called once at startup after guice has finished building the object.
     
    protected abstract String
     
    void
    Called after this object has been fully and successfully constructed

    Methods inherited from class com.codahale.metrics.health.HealthCheck

    check, clock, execute

    Methods inherited from class java.lang.Object

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

    • AbstractHealthCheck

      public AbstractHealthCheck()
  • Method Details

    • getName

      protected abstract String getName()
    • getHealthImplication

      protected HealthImplication getHealthImplication()
    • enabled

      protected boolean enabled()
      Called once at startup after guice has finished building the object. If this method returns false then the object will not be registered with the HealthCheckRegistry
      Returns:
      true by default if not overridden
    • postConstruct

      public void postConstruct()
      Description copied from interface: GuiceLifecycleListener
      Called after this object has been fully and successfully constructed
      Specified by:
      postConstruct in interface GuiceLifecycleListener