org.springframework.boot.actuate.health.AbstractHealthIndicator源码实例Demo

类org.springframework.boot.actuate.health.AbstractHealthIndicator源码实例Demo

下面列出了org.springframework.boot.actuate.health.AbstractHealthIndicator 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: data-highway   文件: HealthChecks.java
@Bean
public AbstractHealthIndicator dummyHealthCheck(Receiver receiver) {
  return new AbstractHealthIndicator() {
    @Override
    protected void doHealthCheck(Health.Builder builder) throws Exception {
      checkState(true, "True is no longer true");
      builder.up().withDetail("truth", "True is true");
    }
  };
}
 
@Bean
public HealthIndicator healthIndicator() {
	return new AbstractHealthIndicator() {
		@Override
		protected void doHealthCheck(Health.Builder builder) throws Exception {
			builder.up();
		}
	};
}
 
@Bean
public HealthIndicator healthIndicator() {
	return new AbstractHealthIndicator() {
		@Override
		protected void doHealthCheck(Health.Builder builder) throws Exception {
			builder.down();
		}
	};
}
 
@Bean
public HealthIndicator healthIndicator() {
	return new AbstractHealthIndicator() {
		@Override
		protected void doHealthCheck(Health.Builder builder) throws Exception {
			builder.status("fatal");
		}
	};
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法