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