1 |
torben |
402 |
package dk.thoerup.curcuitbreaker.jmx; |
2 |
|
|
|
3 |
|
|
import dk.thoerup.curcuitbreaker.CircuitBreaker; |
4 |
|
|
|
5 |
|
|
public class JmxCircuitBreaker implements JmxCircuitBreakerMBean { |
6 |
|
|
|
7 |
|
|
private CircuitBreaker cb; |
8 |
|
|
|
9 |
|
|
public JmxCircuitBreaker(CircuitBreaker cb) { |
10 |
|
|
this.cb = cb; |
11 |
|
|
} |
12 |
|
|
|
13 |
|
|
public String getName() { |
14 |
|
|
return cb.getName(); |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
public String getStateName() { |
18 |
|
|
return cb.getStateName(); |
19 |
|
|
} |
20 |
torben |
403 |
|
21 |
|
|
public int getThreshold() { |
22 |
|
|
return cb.getThreshold(); |
23 |
|
|
} |
24 |
|
|
|
25 |
|
|
public int getFailureCount() { |
26 |
|
|
return cb.getFailureCount(); |
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
public long getElapsed() { |
30 |
|
|
return cb.getElapsed(); |
31 |
|
|
} |
32 |
torben |
409 |
|
33 |
|
|
public String getNotifierName() { |
34 |
|
|
return cb.getNotifierName(); |
35 |
|
|
} |
36 |
torben |
402 |
|
37 |
|
|
public void reset() { |
38 |
|
|
cb.reset(); |
39 |
|
|
|
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
public void tripBreaker() { |
43 |
|
|
cb.tripBreaker(); |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
} |