All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.dustlight.jobless.service.health.ManagerChecker Maven / Gradle / Ivy

The newest version!
package cn.dustlight.jobless.service.health;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import cn.dustlight.jobless.core.JobHandlerManager;

@AllArgsConstructor
@Getter
public class ManagerChecker implements HealthIndicator {

    private JobHandlerManager provider;

    @Override
    public Health health() {
        return (provider == null ?
                Health.down().withDetail("message", "Manager is null.") :
                (provider.isAnyClosed() ?
                        Health.down().withDetail("message", "Manager is closed.") :
                        Health.up())).build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy