public String getFromLocalAndSnapshot(String dataId, String group, long timeout) {
    try {
      String result = getConfigureInfomationFromLocal(dataId, group, timeout);
      if (result != null && result.length() > 0) {
        return result;
      }
    } catch (Throwable t) {
      log.error(t.getMessage(), t);
    }

    if (MockServer.isTestMode()) {
      return null;
    }
    return getSnapshotConfigInformation(dataId, group);
  }
Esempio n. 2
0
  /** @param args command line arguments */
  public static void main(String[] args) {

    DConnect2 dc;

    for (String url : args) {
      try {
        System.out.println("");
        System.out.println("");
        System.out.println("########################################################");
        System.out.println("\nConnecting to " + url + "\n");
        dc = new DConnect2(url);

        System.out.println("\n- - - - - - - - - - - - - - - - - - -");

        System.out.println("Retrieving DDS:\n");
        DDS dds = dc.getDDS();
        dds.print(System.out);

        System.out.println("\n- - - - - - - - - - - - - - - - - - -");
        System.out.println("Retrieving DAS:\n");
        DAS das = dc.getDAS();
        das.print(System.out);

        System.out.println("\n- - - - - - - - - - - - - - - - - - -");
        System.out.println("Retrieving DATA:\n");
        dds = dc.getData("");
        dds.printVal(System.out, "");

        System.out.println("\n- - - - - - - - - - - - - - - - - - -");
        System.out.println("Retrieving DDX:\n");
        dds = dc.getDDX();
        dds.printXML(System.out);

      } catch (Throwable t) {
        t.printStackTrace(System.err);
      }
    }
  }