/[projects]/CircuitBreaker/src/dk/thoerup/curcuitbreaker/HalfOpenState.java
ViewVC logotype

Annotation of /CircuitBreaker/src/dk/thoerup/curcuitbreaker/HalfOpenState.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 424 - (hide annotations) (download)
Thu Oct 8 20:39:39 2009 UTC (14 years, 8 months ago) by torben
File size: 565 byte(s)
Various cleanup
1 torben 393 package dk.thoerup.curcuitbreaker;
2    
3    
4    
5 torben 424 public final class HalfOpenState implements CircuitBreakerState {
6 torben 393
7     public void preInvoke(CircuitBreaker circuitBreaker) throws Throwable
8     {
9     // NO OP
10     }
11    
12     public void postInvoke(CircuitBreaker circuitBreaker) throws Throwable
13     {
14     circuitBreaker.reset();
15     }
16    
17     public void onError(CircuitBreaker circuitBreaker, Throwable e) throws Throwable
18     {
19     circuitBreaker.tripBreaker();
20     throw new CircuitBreakerException(e);
21     }
22 torben 397
23     public String getName() {
24     return "Half-open";
25     }
26 torben 393 }

  ViewVC Help
Powered by ViewVC 1.1.20