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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
enabled()
Called once at startup after guice has finished building the object.protected HealthImplication
protected abstract String
getName()
void
Called after this object has been fully and successfully constructedMethods inherited from class com.codahale.metrics.health.HealthCheck
check, clock, execute
-
Constructor Details
-
AbstractHealthCheck
public AbstractHealthCheck()
-
-
Method Details
-
getName
-
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 theHealthCheckRegistry
- 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 interfaceGuiceLifecycleListener
-