public abstract class HealthCheck extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HealthCheck.Result
The result of a
HealthCheck being run. |
| Modifier | Constructor and Description |
|---|---|
protected |
HealthCheck(String name)
Create a new
HealthCheck instance with the given name. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract HealthCheck.Result |
check()
Perform a check of the application component.
|
HealthCheck.Result |
execute()
Executes the health check, catching and handling any exceptions raised by
check(). |
String |
getName()
Returns the health check's name.
|
protected HealthCheck(String name)
HealthCheck instance with the given name.name - the name of the health check (and, ideally, the name of the underlying
component the health check tests)public String getName()
protected abstract HealthCheck.Result check() throws Exception
HealthCheck.Result; otherwise, an unhealthy
HealthCheck.Result with a descriptive error message or exceptionException - if there is an unhandled error during the health check; this will result in
a failed health checkpublic HealthCheck.Result execute()
check().HealthCheck.Result; otherwise, an unhealthy
HealthCheck.Result with a descriptive error message or exceptionCopyright © 2012. All Rights Reserved.