2 |
|
|
3 |
import dk.thoerup.curcuitbreaker.AccountingCircuitBreaker; |
import dk.thoerup.curcuitbreaker.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 |
|
|
22 |
return cb.getBlockCount(); |
return cb.getBlockCount(); |
23 |
} |
} |
24 |
|
|
25 |
public int getFailureCount() { |
public int getTotalFailureCount() { |
26 |
return cb.getFailureCount(); |
return cb.getTotalFailureCount(); |
27 |
} |
} |
28 |
|
|
29 |
public long getLastReset() { |
public long getLastReset() { |
30 |
return cb.getLastReset(); |
return cb.getLastReset(); |
31 |
} |
} |
32 |
|
|
33 |
|
public int getTotalCallCount() { |
34 |
|
return cb.getTotalCallCount(); |
35 |
|
} |
36 |
|
|
37 |
public void resetCounters() { |
public void resetCounters() { |
38 |
cb.resetCounters(); |
cb.resetCounters(); |
39 |
} |
} |