Example #1
0
 public void setProperty(StringProperty stringproperty, String s) throws NullPointerException {
   if (stringproperty == pMachineName) {
     String s1 = getFullMachineID(this, s);
     os = Machine.getOS(s1);
   }
   super.setProperty(stringproperty, s);
 }
  public static void main(String args[]) {
    try {
      int i = 0;
      ArrayList array = new ArrayList();
      ArrayList array1 = new ArrayList();
      for (int j = i; j < args.length - 1; j++) {
        array1.add(args[j]);
      }

      ArrayList array2 = new ArrayList();
      array2.add(args[args.length - 1]);
      array.add(GET_NEW_DATA);
      array.add(array1);
      array.add(array2);
      BrowsableExeBase browsableexebase = (BrowsableExeBase) AtomicMonitor.MonitorCreate(args[i]);
      String s = ArgsPackagerUtil.packageArgs(array, 0, array.size() - 1);
      String s1 = ArgsPackagerUtil.encodeArgs(s);
      ArrayList array3 = new ArrayList();
      String s2 = browsableexebase.getExePath() + " " + s1;
      System.out.println(s2);
      int k = browsableexebase.exec(s2, array3);
      System.out.println("exitCode: " + k);
      for (int l = 0; l < array3.size(); l++) {
        System.out.println(array3.get(l));
      }

    } catch (Exception exception) {
      exception.printStackTrace();
    }
    System.exit(0);
  }
Example #3
0
 public static String getFullMachineID(AtomicMonitor atomicmonitor, String s) {
   String s1 = atomicmonitor.getFullID();
   SiteViewObject siteviewobject = Portal.getSiteViewForID(s1);
   if (siteviewobject instanceof PortalSiteView) {
     s = s + "@" + Portal.getServerID(s1) + ":";
   }
   return s;
 }
Example #4
0
 public void initialize(HashMap hashmap) {
   super.initialize(hashmap);
   String s = getProperty("_machineUsername");
   if (s.length() > 0) {
     String s1 = getProperty("_machinePassword");
     String s2 = getProperty(pMachineName);
     Machine.addNTMachineLogin(s2, s, s1);
   }
 }
Example #5
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);
 }
Example #6
0
 public void preprocessValuesTable(HashMap hashmap) {
   String s = "_machine";
   String s1 = (String) hashmap.get(s);
   if (s1 != null) {
     StringProperty stringproperty = getPropertyObject(s);
     if (stringproperty != null) {
       String s2 = TextUtils.getValue(hashmap, "__portalServerID");
       String s3 = s1;
       if (s2.length() > 0) {
         s3 = s3 + "@" + s2;
         if (!s3.endsWith(":")) {
           s3 = s3 + ":";
         }
       }
       os = Machine.getOS(s3);
       valuesTable.add(stringproperty, s1);
     }
     hashmap.remove(s);
   }
   super.preprocessValuesTable(hashmap);
 }
Example #7
0
 protected void stopMonitor() {
   super.stopMonitor();
   removeRemote(this);
 }
Example #8
0
 protected void startMonitor() {
   addRemote(this);
   super.startMonitor();
 }