org.zodiac.actuate.health.checker.LivenessHealthIndicator Maven / Gradle / Ivy
The newest version!
package org.zodiac.actuate.health.checker;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
public class LivenessHealthIndicator extends AbstractHealthIndicator {
private LivenessHealthCheckerProcessor livenessHealthCheckProcessor;
public LivenessHealthIndicator(LivenessHealthCheckerProcessor livenessHealthCheckProcessor) {
this.livenessHealthCheckProcessor = livenessHealthCheckProcessor;
}
@Override
protected void doHealthCheck(Health.Builder builder) throws Exception {
Health health = livenessHealthCheckProcessor.healthCheck();
builder.status(health.getStatus()).withDetails(health.getDetails());
}
}