1 |
package dk.thoerup.curcuitbreaker; |
package dk.thoerup.circuitbreaker; |
2 |
|
|
3 |
import java.util.concurrent.atomic.AtomicLong; |
import java.util.concurrent.atomic.AtomicLong; |
4 |
|
|
12 |
this.timeout.set( timeout ); |
this.timeout.set( timeout ); |
13 |
} |
} |
14 |
|
|
15 |
public void preInvoke(CircuitBreaker circuitBreaker) throws Throwable |
public void preInvoke(CircuitBreaker circuitBreaker) throws Exception |
16 |
{ |
{ |
17 |
long now = System.currentTimeMillis(); |
long now = System.currentTimeMillis(); |
18 |
long elapsed = now - tripTime.get(); |
long elapsed = now - tripTime.get(); |
27 |
} |
} |
28 |
} |
} |
29 |
|
|
30 |
public void postInvoke(CircuitBreaker circuitBreaker) throws Throwable |
public void postInvoke(CircuitBreaker circuitBreaker) throws Exception |
31 |
{ |
{ |
32 |
// NO OP |
// NO OP |
33 |
} |
} |
34 |
|
|
35 |
public void onError(CircuitBreaker circuitBreaker, Throwable t) throws Throwable |
public void onError(CircuitBreaker circuitBreaker, Exception t) throws Exception |
36 |
{ |
{ |
37 |
// NO OP |
// NO OP |
38 |
} |
} |