public class HealthCheckRegistry extends Object
| Constructor and Description |
|---|
HealthCheckRegistry()
Creates a new
HealthCheckRegistry. |
| Modifier and Type | Method and Description |
|---|---|
SortedSet<String> |
getNames()
Returns a set of the names of all registered health checks.
|
void |
register(String name,
HealthCheck healthCheck)
Registers an application
HealthCheck. |
HealthCheck.Result |
runHealthCheck(String name)
Runs the health check with the given name.
|
SortedMap<String,HealthCheck.Result> |
runHealthChecks()
Runs the registered health checks and returns a map of the results.
|
SortedMap<String,HealthCheck.Result> |
runHealthChecks(ExecutorService executor)
Runs the registered health checks in parallel and returns a map of the results.
|
void |
unregister(String name)
Unregisters the application
HealthCheck with the given name. |
public HealthCheckRegistry()
HealthCheckRegistry.public void register(String name, HealthCheck healthCheck)
HealthCheck.name - the name of the health checkhealthCheck - the HealthCheck instancepublic void unregister(String name)
HealthCheck with the given name.name - the name of the HealthCheck instancepublic SortedSet<String> getNames()
public HealthCheck.Result runHealthCheck(String name) throws NoSuchElementException
name - the health check's nameNoSuchElementException - if there is no health check with the given namepublic SortedMap<String,HealthCheck.Result> runHealthChecks()
public SortedMap<String,HealthCheck.Result> runHealthChecks(ExecutorService executor)
executor - object to launch and track health checks progressCopyright © 2015. All Rights Reserved.