Class DefaultReactiveHealthIndicatorRegistry
- java.lang.Object
- org.springframework.boot.actuate.health.DefaultReactiveHealthIndicatorRegistry
- All Implemented Interfaces:
ReactiveHealthIndicatorRegistry
public class DefaultReactiveHealthIndicatorRegistry extends Object implements ReactiveHealthIndicatorRegistry
Default implementation ofReactiveHealthIndicatorRegistry
.- Since:
- 2.1.0
Constructor Summary
Constructors Constructor Description DefaultReactiveHealthIndicatorRegistry()
Create a newDefaultReactiveHealthIndicatorRegistry
.DefaultReactiveHealthIndicatorRegistry(Map<String,ReactiveHealthIndicator> healthIndicators)
Create a newDefaultReactiveHealthIndicatorRegistry
from the specified indicators.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReactiveHealthIndicator
get(String name)
Returns theReactiveHealthIndicator
registered with the givenname
.Map<String,ReactiveHealthIndicator>
getAll()
Returns a snapshot of the registered health indicators and their names.void
register(String name, ReactiveHealthIndicator healthIndicator)
Registers the givenReactiveHealthIndicator
, associating it with the givenname
.ReactiveHealthIndicator
unregister(String name)
Unregisters theReactiveHealthIndicator
previously registered with the givenname
.
Constructor Detail
DefaultReactiveHealthIndicatorRegistry
public DefaultReactiveHealthIndicatorRegistry()
Create a newDefaultReactiveHealthIndicatorRegistry
.
DefaultReactiveHealthIndicatorRegistry
public DefaultReactiveHealthIndicatorRegistry(Map<String,ReactiveHealthIndicator> healthIndicators)
Create a newDefaultReactiveHealthIndicatorRegistry
from the specified indicators.- Parameters:
healthIndicators
- a map ofHealthIndicator
s with the key being used as an indicator name.
Method Detail
register
public void register(String name, ReactiveHealthIndicator healthIndicator)
Description copied from interface:ReactiveHealthIndicatorRegistry
Registers the givenReactiveHealthIndicator
, associating it with the givenname
.- Specified by:
register
in interfaceReactiveHealthIndicatorRegistry
- Parameters:
name
- the name of the indicatorhealthIndicator
- the indicator
unregister
public ReactiveHealthIndicator unregister(String name)
Description copied from interface:ReactiveHealthIndicatorRegistry
Unregisters theReactiveHealthIndicator
previously registered with the givenname
.- Specified by:
unregister
in interfaceReactiveHealthIndicatorRegistry
- Parameters:
name
- the name of the indicator- Returns:
- the unregistered indicator, or
null
if no indicator was found in the registry for the givenname
.
get
public ReactiveHealthIndicator get(String name)
Description copied from interface:ReactiveHealthIndicatorRegistry
Returns theReactiveHealthIndicator
registered with the givenname
.- Specified by:
get
in interfaceReactiveHealthIndicatorRegistry
- Parameters:
name
- the name of the indicator- Returns:
- the health indicator, or
null
if no indicator was registered with the givenname
.
getAll
public Map<String,ReactiveHealthIndicator> getAll()
Description copied from interface:ReactiveHealthIndicatorRegistry
Returns a snapshot of the registered health indicators and their names. The contents of the map do not reflect subsequent changes to the registry.- Specified by:
getAll
in interfaceReactiveHealthIndicatorRegistry
- Returns:
- the snapshot of registered health indicators