/[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 1315 by torben, Tue Apr 19 15:46:22 2011 UTC revision 1316 by torben, Tue Apr 19 17:17:09 2011 UTC
# Line 33  public class CircuitBreakerListener impl Line 33  public class CircuitBreakerListener impl
33      public void contextInitialized(ServletContextEvent sce) {      public void contextInitialized(ServletContextEvent sce) {
34          logger.warning("Context Init");          logger.warning("Context Init");
35                    
36          int threshold = Integer.parseInt(sce.getServletContext().getInitParameter("banedk_threshold") );          TraininfoSettings settings = SettingsListener.loadSettings( sce.getServletContext() );
37          int timeout = Integer.parseInt( sce.getServletContext().getInitParameter("banedk_timeout") );  
38          CircuitBreakerManager mgr = CircuitBreakerManager.getManager();          CircuitBreakerManager mgr = CircuitBreakerManager.getManager();
39                    
40                  CompositeNotifier notif = new CompositeNotifier();                  CompositeNotifier notif = new CompositeNotifier();
# Line 42  public class CircuitBreakerListener impl Line 42  public class CircuitBreakerListener impl
42                  notif.addNotifier( new MailNotifier("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") );
43                                    
44                    
45                  LoggingCircuitBreaker banedk = new LoggingCircuitBreaker("banedk", threshold, timeout);                  LoggingCircuitBreaker banedk = new LoggingCircuitBreaker("banedk", settings);
46                  banedk.setNotifier(notif);                  banedk.setNotifier(notif);
47                  mgr.addCircuitBreaker( banedk );                  mgr.addCircuitBreaker( banedk );
48                                    
49                                    
50                  AccountingCircuitBreaker metro = new AccountingCircuitBreaker("metro", threshold, timeout);                  AccountingCircuitBreaker metro = new AccountingCircuitBreaker("metro", settings);
51                  metro.setNotifier(notif);                  metro.setNotifier(notif);
52                  mgr.addCircuitBreaker( metro );                  mgr.addCircuitBreaker( metro );
53                                    

Legend:
Removed from v.1315  
changed lines
  Added in v.1316

  ViewVC Help
Powered by ViewVC 1.1.20