--- CircuitBreaker/src/dk/thoerup/curcuitbreaker/web/ActionCommand.java 2009/10/08 07:21:46 418 +++ miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/web/ActionCommand.java 2015/06/09 08:55:10 2569 @@ -1,4 +1,4 @@ -package dk.thoerup.curcuitbreaker.web; +package dk.thoerup.circuitbreaker.web; import java.io.IOException; import java.net.URLEncoder; @@ -6,9 +6,10 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import dk.thoerup.curcuitbreaker.AccountingCircuitBreaker; -import dk.thoerup.curcuitbreaker.CircuitBreaker; -import dk.thoerup.curcuitbreaker.CircuitBreakerManager; +import dk.thoerup.circuitbreaker.CircuitBreaker; +import dk.thoerup.circuitbreaker.CircuitBreakerManager; +import dk.thoerup.circuitbreaker.statistics.AccountingStatistics; +import dk.thoerup.circuitbreaker.statistics.LoggingStatistics; public class ActionCommand implements Command { @@ -32,8 +33,13 @@ cb.tripBreaker(); if (action.equalsIgnoreCase("resetcounters")) { - AccountingCircuitBreaker acb = (AccountingCircuitBreaker) cb; - acb.resetCounters(); + AccountingStatistics stats = (AccountingStatistics) cb.getStatistics(); + stats.resetCounters(); + } + + if (action.equalsIgnoreCase("clearlog") ) { + LoggingStatistics stats = (LoggingStatistics) cb.getStatistics(); + stats.clearLog(); } }