public RemoteProcess restartNode(NodeComponent nodeComponent) {
public RemoteProcess restartNode(String nodeName) { NodeInfo nodeInfo = (NodeInfo)nodeToNodeInfo.get(nodeName); String hostName = nodeInfo.hostName; Properties properties = nodeInfo.properties; java.util.List args = nodeInfo.args;
  public RemoteProcess restartNode(NodeComponent nodeComponent) {    boolean doRun = false;    synchronized (runningNodes) {      if (oldNodes.size() + runningNodes.size() == 1)        doRun = true;    } // end synchronized    if (doRun) {      runButton_actionPerformed();      return null; // it doesn't matter what we return, the caller is going away    }    RemoteHost remoteAppServer = null;    // get host component by searching hosts for one with this node.    String hostName = null;    HostComponent[] hosts = experiment.getHostComponents();    for (int i = 0; i < hosts.length; i++) {      NodeComponent[] nodes = hosts[i].getNodes();      for (int j = 0; j < nodes.length; j++) {        if (nodes[j].equals(nodeComponent)) {          hostName = hosts[i].getShortName();          break;        }      }    }    Properties properties = getNodeMinusD(nodeComponent, hostName);    // WARNING: Some users may find this odd - they may _want_    // a restarted node to use persistence information!    // Eventually, we should allow this.    properties.remove(Experiment.PERSIST_CLEAR);    java.util.List args = getNodeArguments(nodeComponent);    int remotePort = getAppServerPort(properties);    try {      remoteAppServer =         remoteHostRegistry.lookupRemoteHost(            hostName, remotePort, true);    } catch (Exception e) {      if(log.isErrorEnabled()) {        log.error("Exception getting Host Server", e);      }      return null;    }    // close the log file and remove the old node event listener    String nodeName = nodeComponent.getShortName();    ConsoleNodeListener listener =       (ConsoleNodeListener)nodeListeners.remove(nodeName);    listener.closeLogFile();    // reuse old document    ConsoleStyledDocument doc = listener.getDocument();    // create a node event listener to get events from the node    String logFileName = getLogFileName(nodeName);    try {      listener = new ConsoleNodeListener(this,					 nodeComponent,                                         logFileName,					 getNodeStatusButton(nodeName),                                         doc);    } catch (Exception e) {      if(log.isErrorEnabled()) {        log.error("Unable to create output for: " + nodeName, e);      }      return null;    }    if (displayFilter != null)      listener.setFilter(displayFilter);    nodeListeners.put(nodeName, listener);    RemoteProcess remoteNode = null;    try {      String procName =          experiment.getExperimentName() + "-" +          nodeName;      String groupName = "csmart";      ProcessDescription desc =        new ProcessDescription(            procName,            groupName,            properties,            args);      RemoteListenableConfig conf =        new RemoteListenableConfig(            listener,             new OutputPolicy(10));      remoteNode =         remoteAppServer.createRemoteProcess(            desc,            conf);      if (remoteNode != null) {        synchronized (runningNodesLock) {          runningNodes.put(nodeComponent, remoteNode);        } // end synchronized      }    } catch (Exception e) {      if(log.isErrorEnabled()) {        log.error("Exception", e);      }    }    return remoteNode;  }