org.zodiac.actuate.health.AppReactiveHealthContributor Maven / Gradle / Ivy
The newest version!
package org.zodiac.actuate.health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.zodiac.sdk.toolkit.util.AssertUtil;
public interface AppReactiveHealthContributor {
static AppReactiveHealthContributor adapt(AppHealthContributor healthContributor) {
AssertUtil.notNull(healthContributor, "HealthContributor must not be null");
if (healthContributor instanceof HealthIndicator) {
return new AppHealthIndicatorReactiveAdapter((HealthIndicator)healthContributor);
}
if (healthContributor instanceof AppCompositeHealthContributor) {
return new AppCompositeHealthContributorReactiveAdapter((AppCompositeHealthContributor)healthContributor);
}
throw new IllegalStateException("Unknown HealthContributor type");
}
}