6 |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletRequest; |
7 |
import javax.servlet.http.HttpServletResponse; |
import javax.servlet.http.HttpServletResponse; |
8 |
|
|
|
import dk.thoerup.circuitbreaker.AccountingCircuitBreaker; |
|
9 |
import dk.thoerup.circuitbreaker.CircuitBreaker; |
import dk.thoerup.circuitbreaker.CircuitBreaker; |
10 |
import dk.thoerup.circuitbreaker.CircuitBreakerManager; |
import dk.thoerup.circuitbreaker.CircuitBreakerManager; |
11 |
import dk.thoerup.circuitbreaker.LoggingCircuitBreaker; |
import dk.thoerup.circuitbreaker.statistics.AccountingStatistics; |
12 |
|
import dk.thoerup.circuitbreaker.statistics.LoggingStatistics; |
13 |
|
|
14 |
public class ActionCommand implements Command { |
public class ActionCommand implements Command { |
15 |
|
|
33 |
cb.tripBreaker(); |
cb.tripBreaker(); |
34 |
|
|
35 |
if (action.equalsIgnoreCase("resetcounters")) { |
if (action.equalsIgnoreCase("resetcounters")) { |
36 |
AccountingCircuitBreaker acb = (AccountingCircuitBreaker) cb; |
AccountingStatistics stats = (AccountingStatistics) cb.getStatistics(); |
37 |
acb.resetCounters(); |
stats.resetCounters(); |
38 |
} |
} |
39 |
|
|
40 |
if (action.equalsIgnoreCase("clearlog") ) { |
if (action.equalsIgnoreCase("clearlog") ) { |
41 |
LoggingCircuitBreaker lcb = (LoggingCircuitBreaker) cb; |
LoggingStatistics stats = (LoggingStatistics) cb.getStatistics(); |
42 |
lcb.clearLog(); |
stats.clearLog(); |
43 |
} |
} |
44 |
} |
} |
45 |
|
|