Exemplo n.º 1
0
  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);
  }
Exemplo n.º 2
0
  protected boolean update() {
    ArrayList array = new ArrayList();
    int i = 0;
    do {
      if (i >= nMaxCounters) {
        break;
      }
      String s = getProperty(PROPERTY_NAME_COUNTER_ID + (i + 1));
      if (s.length() <= 0) {
        break;
      }
      array.add(s);
      i++;
    } while (true);
    i = array.size();
    ArrayList array1 = getConnArgs();
    ArrayList array2 = new ArrayList();
    array2.add(GET_NEW_DATA);
    array2.add(array1);
    array2.add(array);
    String s1 = ArgsPackagerUtil.packageArgs(array2, 0, array2.size() - 1);
    String s2 = ArgsPackagerUtil.encodeArgs(s1);
    ArrayList array3 = new ArrayList();
    int j = exec(getExePath() + " " + s2, array3);
    int k = getFirstValidIndex(array3);
    for (int l = 1; l <= nMaxCounters; l++) {
      setProperty(PROPERTY_NAME_COUNTER_VALUE + l, "n/a");
    }

    if (stillActive()) {
      synchronized (this) {
        String s3 = "";
        setProperty(getPropertyObject(PROPERTY_NAME_COUNTERS_IN_ERROR), i);
        if (k < 0) {
          s3 = "Failed to get performance data. Error code: " + j;
        } else if (j != 0) {
          StringBuffer stringbuffer = new StringBuffer();
          for (int j1 = k; j1 < array3.size(); j1++) {
            stringbuffer.append((String) array3.get(j1) + " ");
          }

          setProperty(pNoData, "n/a");
          s3 = stringbuffer.toString();
          setProperty(getPropertyObject(PROPERTY_NAME_COUNTERS_IN_ERROR), i);
        } else {
          int i1 = array3.size() - k;
          setProperty(getPropertyObject(PROPERTY_NAME_COUNTERS_IN_ERROR), i - i1);
          s3 = saveResultProps(array3, k);
        }
        setProperty(pStateString, s3);
      }
    }
    return true;
  }
Exemplo n.º 3
0
  public String getBrowseData(StringBuffer stringbuffer) {
    ArrayList array = getConnArgs();
    ArrayList array1 = new ArrayList();
    array1.add(GET_BROWSE_DATA);
    array1.add(array);
    String s =
        ArgsPackagerUtil.encodeArgs(ArgsPackagerUtil.packageArgs(array1, 0, array1.size() - 1));
    ArrayList array2 = new ArrayList();
    int i = exec(getExePath() + " " + s, array2);
    int j = getFirstValidIndex(array2);
    if (j < 0) {
      stringbuffer.append("Failed to get browse data. Error code: " + i);
      return "";
    }
    if (i != 0) {
      stringbuffer.append("Failed to get browse data. Error code: " + i + ". Description: ");
      for (int k = j; k < array2.size(); k++) {
        stringbuffer.append((String) array2.get(k));
      }

      return "";
    }
    int l = 0;
    for (int i1 = j; i1 < array2.size(); i1++) {
      l += ((String) array2.get(i1)).length();
    }

    if (l <= 0) {
      stringbuffer.append("Failed to get browse data. Unspecified error");
      return "";
    }
    StringBuffer stringbuffer1 = new StringBuffer(l);
    for (int j1 = j; j1 < array2.size(); j1++) {
      stringbuffer1.append((String) array2.get(j1));
    }

    return stringbuffer1.toString().trim();
  }