package dk.thoerup.curcuitbreaker; public final class HalfOpenState implements CircuitBreakerState { public void preInvoke(CircuitBreaker circuitBreaker) throws Exception { // NO OP } public void postInvoke(CircuitBreaker circuitBreaker) throws Exception { circuitBreaker.reset(); } public void onError(CircuitBreaker circuitBreaker, Exception e) throws Exception { circuitBreaker.tripBreaker(); throw new CircuitBreakerException(e); } public String getName() { return "Half-open"; } }