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 HealthCheckRegistry
add
(String name, HealthCheckRegistry registry) static void
clear()
static HealthCheckRegistry
Gets the name of the default registry, if it has been setstatic HealthCheckRegistry
getOrCreate
(String name) names()
static void
static HealthCheckRegistry
setDefault
(String name) Creates a new registry and sets it as the default one under the provided name.static HealthCheckRegistry
setDefault
(String name, HealthCheckRegistry healthCheckRegistry) Sets the provided registry as the default one under the provided namestatic HealthCheckRegistry
Same 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
-