类 DefaultHealthIndicatorRegistry
- java.lang.Object
- org.springframework.boot.actuate.health.DefaultHealthIndicatorRegistry
- 所有已实现的接口:
HealthIndicatorRegistry
public class DefaultHealthIndicatorRegistry extends Object implements HealthIndicatorRegistry
Default implementation ofHealthIndicatorRegistry
.- 从以下版本开始:
- 2.1.0
构造器概要
构造器 构造器 说明 DefaultHealthIndicatorRegistry()
Create a newDefaultHealthIndicatorRegistry
.DefaultHealthIndicatorRegistry(Map<String,HealthIndicator> healthIndicators)
Create a newDefaultHealthIndicatorRegistry
from the specified indicators.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 HealthIndicator
get(String name)
Returns theHealthIndicator
registered with the givenname
.Map<String,HealthIndicator>
getAll()
Returns a snapshot of the registered health indicators and their names.void
register(String name, HealthIndicator healthIndicator)
Registers the givenHealthIndicator
, associating it with the givenname
.HealthIndicator
unregister(String name)
Unregisters theHealthIndicator
previously registered with the givenname
.
构造器详细资料
DefaultHealthIndicatorRegistry
public DefaultHealthIndicatorRegistry()
Create a newDefaultHealthIndicatorRegistry
.
DefaultHealthIndicatorRegistry
public DefaultHealthIndicatorRegistry(Map<String,HealthIndicator> healthIndicators)
Create a newDefaultHealthIndicatorRegistry
from the specified indicators.- 参数:
healthIndicators
- a map ofHealthIndicator
s with the key being used as an indicator name.
方法详细资料
register
public void register(String name, HealthIndicator healthIndicator)
从接口复制的说明:HealthIndicatorRegistry
Registers the givenHealthIndicator
, associating it with the givenname
.- 指定者:
register
在接口中HealthIndicatorRegistry
- 参数:
name
- the name of the indicatorhealthIndicator
- the indicator
unregister
public HealthIndicator unregister(String name)
从接口复制的说明:HealthIndicatorRegistry
Unregisters theHealthIndicator
previously registered with the givenname
.- 指定者:
unregister
在接口中HealthIndicatorRegistry
- 参数:
name
- the name of the indicator- 返回:
- the unregistered indicator, or
null
if no indicator was found in the registry for the givenname
.
get
public HealthIndicator get(String name)
从接口复制的说明:HealthIndicatorRegistry
Returns theHealthIndicator
registered with the givenname
.- 指定者:
get
在接口中HealthIndicatorRegistry
- 参数:
name
- the name of the indicator- 返回:
- the health indicator, or
null
if no indicator was registered with the givenname
.
getAll
public Map<String,HealthIndicator> getAll()
从接口复制的说明:HealthIndicatorRegistry
Returns a snapshot of the registered health indicators and their names. The contents of the map do not reflect subsequent changes to the registry.- 指定者:
getAll
在接口中HealthIndicatorRegistry
- 返回:
- the snapshot of registered health indicators