NodeComponent nodeComponent = nodesToRun[i]; if (createNode(nodeComponent, hostsToRunOn[i])) haveRunningNode = true; } if (!haveRunningNode) { runButton.setSelected(false); runButton.setEnabled(true); unsetTrialValues(); currentTrial--;
if (stopNodeCreation) break; final NodeCreationInfo nci = (NodeCreationInfo)nodeCreationInfoList.get(i); final NodeServesClient nsc; try { nsc = nci.hsc.createNode(nci.uniqueNodeName, nci.properties, nci.args, nci.listener, nci.filter, nci.configWriter); } catch (Exception e) { System.out.println("CSMARTConsole: cannot create node: " + nci.nodeName); JOptionPane.showMessageDialog(this, "Cannot create node on: " + nci.hostName + "; check that server is running"); continue; } synchronized (runningNodesLock) { runningNodes.put(nci.nodeComponent, nsc); } SwingUtilities.invokeLater(new Runnable() { public void run() {  if (nodeCreator == null) return; addStatusButton(nci.statusButton); desktop.addNodeFrame(nci.nodeComponent, (ConsoleNodeListener)nci.listener, new NodeFrameListener(), nci.scrollPane, nci.statusButton, nci.logFileName, nsc, console); updateExperimentControls(experiment, true); } });
  private void createNodes() {    // first set configuration file name in all node components    for (int i = 0; i < nodesToRun.length; i++) {      NodeComponent nodeComponent = nodesToRun[i];      ((ConfigurableComponent)nodeComponent).addProperty("ConfigurationFileName",                                 nodeComponent.getShortName() + currentTrial);    }    String tmp =      Parameters.findParameter("org.cougaar.tools.csmart.startdelay");    int delay = 1;    if (tmp != null) {      try {        delay = Integer.parseInt(tmp);      } catch (NumberFormatException nfe) {      }    }    boolean haveRunningNode = false;    runStart = new Date();    for (int i = 0; i < nodesToRun.length; i++) {      try {        Thread.sleep(delay);      } catch (Exception e) {      }      NodeComponent nodeComponent = nodesToRun[i];      if (createNode(nodeComponent, hostsToRunOn[i]))	haveRunningNode = true;    }    if (!haveRunningNode) {      runButton.setSelected(false);      runButton.setEnabled(true);      unsetTrialValues();      currentTrial--;    }  }