| package pta.de.health; |
| |
| import com.codahale.metrics.health.HealthCheck; |
| import pta.de.api.ServiceDistributionCluster; |
| import pta.de.core.controller.ServicesConfigCache; |
| |
| public class ConfigFilePresentHealthCheck extends HealthCheck { |
| @Override |
| protected Result check() throws Exception { |
| ServiceDistributionCluster[] sdc = ServicesConfigCache.getInstance().getCache(); // Throws Exception if it fails |
| |
| if (sdc != null && sdc.length > 0) { |
| return Result.healthy(); |
| } |
| else { |
| return Result.unhealthy("No ServiceDistributionCluster available!"); |
| } |
| } |
| } |