Package com.codahale.metrics.health
Class SharedHealthCheckRegistries
java.lang.Object
com.codahale.metrics.health.SharedHealthCheckRegistries
A map of shared, named health registries.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HealthCheckRegistryadd(String name, HealthCheckRegistry registry) static voidclear()static HealthCheckRegistryGets the name of the default registry, if it has been setstatic HealthCheckRegistrygetOrCreate(String name) names()static voidstatic HealthCheckRegistrysetDefault(String name) Creates a new registry and sets it as the default one under the provided name.static HealthCheckRegistrysetDefault(String name, HealthCheckRegistry healthCheckRegistry) Sets the provided registry as the default one under the provided namestatic HealthCheckRegistrySame asgetDefault()except returns null when the default registry has not been set.
-
Method Details
-
clear
public static void clear() -
names
-
remove
-
add
-
getOrCreate
-
setDefault
Creates a new registry and sets it as the default one under the provided name.- Parameters:
name- the registry name- Returns:
- the default registry
- Throws:
IllegalStateException- if the name has already been set
-
setDefault
Sets the provided registry as the default one under the provided name- Parameters:
name- the default registry namehealthCheckRegistry- the default registry- Throws:
IllegalStateException- if the default registry has already been set
-
getDefault
Gets the name of the default registry, if it has been set- Returns:
- the default registry
- Throws:
IllegalStateException- if the default has not been set
-
tryGetDefault
Same asgetDefault()except returns null when the default registry has not been set.- Returns:
- the default registry or null
-