/[projects]/miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/web/ActionCommand.java
ViewVC logotype

Diff of /miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/web/ActionCommand.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

CircuitBreaker/src/dk/thoerup/circuitbreaker/web/ActionCommand.java revision 1292 by torben, Fri Apr 15 10:27:04 2011 UTC miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/web/ActionCommand.java revision 3212 by torben, Thu Dec 28 09:34:47 2017 UTC
# Line 6  import java.net.URLEncoder; Line 6  import java.net.URLEncoder;
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                    
# Line 23  public class ActionCommand implements Co Line 23  public class ActionCommand implements Co
23                  String action = req.getParameter("action");                  String action = req.getParameter("action");
24                  String breaker = req.getParameter("breaker");                  String breaker = req.getParameter("breaker");
25                                    
26                  CircuitBreaker cb = CircuitBreakerManager.getManager().getCircuitBreaker(breaker);                  CircuitBreaker<?> cb = CircuitBreakerManager.getManager().getCircuitBreaker(breaker);
27                                    
28                  if (readOnly == false) {                  if (readOnly == false) {
29                          if (action.equalsIgnoreCase("reset"))                          if (action.equalsIgnoreCase("reset"))
# Line 33  public class ActionCommand implements Co Line 33  public class ActionCommand implements Co
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                                    

Legend:
Removed from v.1292  
changed lines
  Added in v.3212

  ViewVC Help
Powered by ViewVC 1.1.20