/[projects]/CircuitBreaker/src/dk/thoerup/circuitbreaker/ClosedState.java
ViewVC logotype

Diff of /CircuitBreaker/src/dk/thoerup/circuitbreaker/ClosedState.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 424 by torben, Thu Oct 8 20:39:39 2009 UTC revision 456 by torben, Tue Oct 20 20:42:36 2009 UTC
# Line 13  public final class ClosedState implement Line 13  public final class ClosedState implement
13                  failureThreshold.set( threshold );                  failureThreshold.set( threshold );
14          }          }
15    
16      public void preInvoke(CircuitBreaker circuitBreaker) throws Throwable      public void preInvoke(CircuitBreaker circuitBreaker) throws Exception
17      {      {
18          // NO OP          // NO OP
19      }      }
20    
21      public void postInvoke(CircuitBreaker circuitBreaker) throws Throwable      public void postInvoke(CircuitBreaker circuitBreaker) throws Exception
22      {      {
23          resetFailureCount();          resetFailureCount();
24      }      }
25    
26      public void onError(CircuitBreaker circuitBreaker, Throwable t) throws Throwable      public void onError(CircuitBreaker circuitBreaker, Exception t) throws Exception
27      {      {
28          int currentCount = failureCount.incrementAndGet();          int currentCount = failureCount.incrementAndGet();
29          int threshold = failureThreshold.get();          int threshold = failureThreshold.get();
# Line 31  public final class ClosedState implement Line 31  public final class ClosedState implement
31              circuitBreaker.tripBreaker();              circuitBreaker.tripBreaker();
32      }      }
33            
34      private void resetFailureCount() {      public void resetFailureCount() {
35          failureCount.set(0);          failureCount.set(0);
36      }      }
37    

Legend:
Removed from v.424  
changed lines
  Added in v.456

  ViewVC Help
Powered by ViewVC 1.1.20