Esempio n. 1
0
 protected void checkSequentially(double ad[], String as[], long l, String s) {
   Array array = getMonitorsToRun();
   long l1 = getSettingAsLong("_CompositeStartupTime", 500);
   long l2 = getSettingAsLong("_CompositeCheckDelay", 500);
   int i = 0;
   AtomicMonitor atomicmonitor = (AtomicMonitor) array.at(i);
   do {
     if (atomicmonitor == null) {
       break;
     }
     try {
       BandwidthMonitor bandwidthmonitor = this;
       atomicmonitor.setTemporaryOwner(bandwidthmonitor);
       boolean flag = atomicmonitor.runUpdate(true);
       if (flag) {
         progressString += "Running monitor " + atomicmonitor.getProperty(pName) + "\n";
         setProperty(pStateString, "checking " + atomicmonitor.getProperty(pName) + "...");
         try {
           Thread.sleep(l1);
         } catch (InterruptedException interruptedexception1) {
         }
         while (atomicmonitor.getProperty(pRunning).length() > 0) {
           try {
             Thread.sleep(l2);
           } catch (InterruptedException interruptedexception2) {
           }
         }
       }
     } finally {
       updateStats(ad, as, atomicmonitor, i++);
       atomicmonitor.setTemporaryOwner(null);
     }
     if (atomicmonitor.getProperty(pCategory).equals(ERROR_CATEGORY)) {
       if (s.equals("stop")) {
         i = array.size() + 1;
         progressString += "Skipping remaining monitors\n";
       } else if (s.equals("last") && i < array.size()) {
         progressString += "Skipping to last monitor\n";
         i = array.size() - 1;
       }
     }
     if (i < array.size()) {
       atomicmonitor = (AtomicMonitor) array.at(i);
     } else {
       atomicmonitor = null;
     }
     if (l > 0L && atomicmonitor != null) {
       try {
         Thread.sleep(l);
       } catch (InterruptedException interruptedexception) {
       }
     }
   } while (true);
 }