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

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

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

revision 1315 by torben, Wed Sep 8 08:11:00 2010 UTC revision 1316 by torben, Tue Apr 19 17:17:09 2011 UTC
# Line 19  public class StatisticsListener implemen Line 19  public class StatisticsListener implemen
19    
20      public void contextInitialized(ServletContextEvent sce) {      public void contextInitialized(ServletContextEvent sce) {
21                    
22          update_interval = getUpdateInterval( sce.getServletContext() );          TraininfoSettings settings = SettingsListener.loadSettings(sce.getServletContext());
           
23                    
24            update_interval = settings.getStatsInterval();                  
25                    
26          if (! sce.getServletContext().getRealPath("/").startsWith("/home/app/")  ) {          if (! sce.getServletContext().getRealPath("/").startsWith("/home/app/")  ) {
27                  //if path not starts with /home/app then it is not running on a production server and we only collects stats on prod servers                  //if path not starts with /home/app then it is not running on a production server and we only collects stats on prod servers
# Line 57  public class StatisticsListener implemen Line 57  public class StatisticsListener implemen
57          }          }
58      }      }
59    
     private int getUpdateInterval(ServletContext cntx) {  
         int interval = 0;  
         try {  
                 String intervalStr = cntx.getInitParameter("stats_interval");  
                 interval = Integer.parseInt(intervalStr);  
         } catch (Exception e) {}  
           
         return interval;  
     }  
60  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.20