Java Code Examples for org.springframework.boot.actuate.health.AbstractHealthIndicator

The following examples show how to use org.springframework.boot.actuate.health.AbstractHealthIndicator. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: data-highway   Source File: HealthChecks.java    License: Apache License 2.0 5 votes vote down vote up
@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");
    }
  };
}
 
Example 2
@Bean
public HealthIndicator healthIndicator() {
	return new AbstractHealthIndicator() {
		@Override
		protected void doHealthCheck(Health.Builder builder) throws Exception {
			builder.up();
		}
	};
}
 
Example 3
@Bean
public HealthIndicator healthIndicator() {
	return new AbstractHealthIndicator() {
		@Override
		protected void doHealthCheck(Health.Builder builder) throws Exception {
			builder.down();
		}
	};
}
 
Example 4
@Bean
public HealthIndicator healthIndicator() {
	return new AbstractHealthIndicator() {
		@Override
		protected void doHealthCheck(Health.Builder builder) throws Exception {
			builder.status("fatal");
		}
	};
}