1 |
package dk.thoerup.circuitbreaker.jmx; |
2 |
|
3 |
import dk.thoerup.circuitbreaker.AccountingCircuitBreaker; |
4 |
|
5 |
public class JmxAccountingCircuitBreaker extends JmxCircuitBreaker implements JmxAccountingCircuitBreakerMBean { |
6 |
|
7 |
private AccountingCircuitBreaker cb; |
8 |
|
9 |
public JmxAccountingCircuitBreaker(AccountingCircuitBreaker cb) { |
10 |
super(cb); |
11 |
this.cb = cb; |
12 |
} |
13 |
|
14 |
|
15 |
//Accounting section |
16 |
|
17 |
public int getTripCount() { |
18 |
return cb.getTripCount(); |
19 |
} |
20 |
|
21 |
public int getBlockCount() { |
22 |
return cb.getBlockCount(); |
23 |
} |
24 |
|
25 |
public int getTotalFailureCount() { |
26 |
return cb.getTotalFailureCount(); |
27 |
} |
28 |
|
29 |
public long getLastTrip() { |
30 |
return cb.getLastTrip(); |
31 |
} |
32 |
|
33 |
public long getLastResetCounters() { |
34 |
return cb.getLastResetCounters(); |
35 |
} |
36 |
|
37 |
public int getTotalCallCount() { |
38 |
return cb.getTotalCallCount(); |
39 |
} |
40 |
|
41 |
public void resetCounters() { |
42 |
cb.resetCounters(); |
43 |
} |
44 |
|
45 |
} |