1 |
package dk.thoerup.curcuitbreaker.jmx; |
2 |
|
3 |
import dk.thoerup.curcuitbreaker.AccountingCircuitBreaker; |
4 |
|
5 |
public class JmxAccountingCircuitBreaker implements JmxAccountingCircuitBreakerMBean { |
6 |
|
7 |
private AccountingCircuitBreaker cb; |
8 |
|
9 |
public JmxAccountingCircuitBreaker(AccountingCircuitBreaker cb) { |
10 |
this.cb = cb; |
11 |
} |
12 |
|
13 |
|
14 |
|
15 |
//default section |
16 |
|
17 |
public String getName() { |
18 |
return cb.getName(); |
19 |
} |
20 |
|
21 |
public String getStateName() { |
22 |
return cb.getStateName(); |
23 |
} |
24 |
|
25 |
public void reset() { |
26 |
cb.reset(); |
27 |
|
28 |
} |
29 |
|
30 |
public void tripBreaker() { |
31 |
cb.tripBreaker(); |
32 |
} |
33 |
|
34 |
//Accounting section |
35 |
|
36 |
public int getTripCount() { |
37 |
return cb.getTripCount(); |
38 |
} |
39 |
|
40 |
public int getBlockCount() { |
41 |
return cb.getBlockCount(); |
42 |
} |
43 |
|
44 |
public int getFailureCount() { |
45 |
return cb.getFailureCount(); |
46 |
} |
47 |
|
48 |
public long getLastReset() { |
49 |
return cb.getLastReset(); |
50 |
} |
51 |
|
52 |
public void resetCounters() { |
53 |
cb.resetCounters(); |
54 |
} |
55 |
|
56 |
} |