//    private JdbcConfigurationImpl createConfiguration() {
 //        EmsConfigFileProperty p = (EmsConfigFileProperty)
 // getPropertyObject("_emsConfigFilePath");
 //        String configurationFilePath = p.getFileName(this);
 //        long timeDiff = getTimeDiffValue();
 //        String select = getProperty("_select");
 //        String from = getProperty("_from");
 //        String where = getProperty("_where");
 //        String orderby = getProperty("_orderBy");
 //        String driver = getProperty("_driver");
 //        String url = getProperty("_database");
 //        String user = getProperty("_user");
 //        String password = getProperty("_password");
 //        return new JdbcConfigurationImpl(select, from, where, orderby, driver, url, user,
 // password, configurationFilePath, timeDiff);
 //    }
 //
 public void initialize(HashMap args) {
   super.initialize(args);
   //        if (emulator == null) {
   //            emulator = MonitorEmulator.createInstance(new Integer(getUniqueInternalId()),
   // this);
   //        }
   //        JdbcConfiguration cfg = createJdbcConf(args);
   //        emulator.init(cfg, isDisabled());
 }
示例#2
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);
 }
 protected void stopMonitor() {
   //        emulator.stop();
   super.stopMonitor();
 }
 public void notifyDelete() {
   //        emulator.notifyDelete();
   super.notifyDelete();
 }