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