/[projects]/CircuitBreaker/src/dk/thoerup/circuitbreaker/LoggingCircuitBreaker.java
ViewVC logotype

Diff of /CircuitBreaker/src/dk/thoerup/circuitbreaker/LoggingCircuitBreaker.java

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

revision 1285 by torben, Mon Apr 11 07:52:15 2011 UTC revision 1292 by torben, Fri Apr 15 10:27:04 2011 UTC
# Line 31  public class LoggingCircuitBreaker exten Line 31  public class LoggingCircuitBreaker exten
31                  super.tripBreaker();                  super.tripBreaker();
32                  addEntry(Notifier.Event.BreakerTripped);                  addEntry(Notifier.Event.BreakerTripped);
33          }          }
34            
35    /* don't log retrips - they are not as interesting as trips and resets
36          @Override          @Override
37          public void retripBreaker() {          public void retripBreaker() {
38                  super.retripBreaker();                  super.retripBreaker();
39                  addEntry(Notifier.Event.BreakerRetripped);                  addEntry(Notifier.Event.BreakerRetripped);
40          }          }
41    */
42    
43          @Override          @Override
44          public void reset() {          public void reset() {
# Line 53  public class LoggingCircuitBreaker exten Line 55  public class LoggingCircuitBreaker exten
55                  }                  }
56          }          }
57    
58            public void clearLog() {
59                    synchronized(this) {
60                            log.clear();
61                    }
62            }
63    
64          public LinkedList<LogEntry> getLog() {          public LinkedList<LogEntry> getLog() {
65                  synchronized(this) {                  synchronized(this) {
66                          return new LinkedList<LogEntry>(log); //return a copy so caller can to whatever he wants, when he wants                          return new LinkedList<LogEntry>(log); //return a copy so caller can to whatever he wants, when he wants

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

  ViewVC Help
Powered by ViewVC 1.1.20