/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/CircuitBreakerListener.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/CircuitBreakerListener.java

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

revision 1161 by torben, Sun Oct 3 17:23:13 2010 UTC revision 1162 by torben, Mon Oct 4 17:38:13 2010 UTC
# Line 34  public class CircuitBreakerListener impl Line 34  public class CircuitBreakerListener impl
34          int timeout = Integer.parseInt( sce.getServletContext().getInitParameter("banedk_timeout") );          int timeout = Integer.parseInt( sce.getServletContext().getInitParameter("banedk_timeout") );
35          CircuitBreakerManager mgr = CircuitBreakerManager.getManager();          CircuitBreakerManager mgr = CircuitBreakerManager.getManager();
36                    
           
                 AccountingCircuitBreaker banedk = new AccountingCircuitBreaker("banedk", threshold, timeout);  
37                  CompositeNotifier notif = new CompositeNotifier();                  CompositeNotifier notif = new CompositeNotifier();
38                  notif.addNotifier( new JavaLogNotifier() );                  notif.addNotifier( new JavaLogNotifier() );
39                  notif.addNotifier( new MailNotifier(banedk,"traininfo@t-hoerup.dk", "torben@t-hoerup.dk", "192.168.10.5") );                  notif.addNotifier( new MailNotifier("traininfo@t-hoerup.dk", "torben@t-hoerup.dk", "192.168.10.5") );
40                    
41            
42                    AccountingCircuitBreaker banedk = new AccountingCircuitBreaker("banedk", threshold, timeout);
43                  banedk.setNotifier(notif);                  banedk.setNotifier(notif);
44                  mgr.addCircuitBreaker( banedk );                  mgr.addCircuitBreaker( banedk );
45                                    
46                    
47                  AccountingCircuitBreaker metro = new AccountingCircuitBreaker("metro", threshold, timeout);                  AccountingCircuitBreaker metro = new AccountingCircuitBreaker("metro", threshold, timeout);
48                  notif = new CompositeNotifier();                  metro.setNotifier(notif);
                 notif.addNotifier( new JavaLogNotifier() );  
                 notif.addNotifier( new MailNotifier(banedk,"traininfo@t-hoerup.dk", "torben@t-hoerup.dk", "192.168.10.5") );  
                 banedk.setNotifier(notif);  
49                  mgr.addCircuitBreaker( metro );                  mgr.addCircuitBreaker( metro );
50                                    
51                  JMXWrapper.registerAllCircuitBreakers();                  JMXWrapper.registerAllCircuitBreakers();

Legend:
Removed from v.1161  
changed lines
  Added in v.1162

  ViewVC Help
Powered by ViewVC 1.1.20