public KaryonBootstrapSuite(HealthCheckHandler healthcheckHandler) { this.healthcheckHandler = null == healthcheckHandler ? new AlwaysHealthyHealthCheck() : healthcheckHandler; healthcheckHandlerClass = null; }
public HealthCheckStatus get() { return healthCheck.check().join(); }
public static HealthIndicatorStatus healthy(String name, Map<String, Object> attr) { return create(name, true, attr, null); }
@Override public int invokeCheck() throws TimeoutException { return handler.getStatus(); }
@Override public String getName() { return delegate.getName(); } }
/** * Return false is any of the health indicators are unhealthy. * @param statuses * @return */ private boolean calcIsHealthy(List<HealthIndicatorStatus> statuses) { for (HealthIndicatorStatus status : statuses) { if (!status.isHealthy()) { return false; } } return true; }
public static HealthIndicatorRegistry from(HealthIndicator... healthChecks) { return from(Arrays.asList(healthChecks)); } }
public static HealthCheckStatus healthy(HealthState state) { return new HealthCheckStatus(state, Collections.emptyList()); }
public static HealthIndicatorStatus unhealthy(String name, Map<String, Object> attr, Throwable t) { return create(name, false, attr, t); }
public static HealthIndicatorStatus unhealthy(String name, Map<String, Object> attr) { return create(name, false, attr, null); }
public static HealthIndicatorStatus healthy(String name) { return create(name, true, Collections.<String, Object>emptyMap(), null); }