public synchronized ArrayList getNodesToAttach() { if (appServers.size() == 0)
private String[] getNodesToAttach(ArrayList nodes) { Object[] selected = Util.getObjectsFromList(null, nodes, "Attach to Nodes", "Select Nodes:"); if (selected != null) { ArrayList sel = new ArrayList(selected.length); for (int i = 0; i < selected.length; i++) sel.add(selected[i]); return (String[])sel.toArray(new String[selected.length]); } else
  public synchronized ArrayList getNodesToAttach() {    if (appServers.size() == 0)      return null;    Set processNames = nodeToAppServer.keySet();    if (processNames.size() == 0)      return null;    ArrayList results = new ArrayList();    String[] attachToNodes = getNodesToAttach(new ArrayList(processNames));    for (int i = 0; i < attachToNodes.length; i++) {      String processName = attachToNodes[i];      AppServerDesc desc = (AppServerDesc)nodeToAppServer.get(processName);      RemoteHost appServer = desc.appServer;      ProcessDescription pd = null;      try {        pd = appServer.getProcessDescription(processName);      } catch (Exception e) {        if (log.isErrorEnabled()) {          log.error("Exception attaching to: " + processName, e);        }        continue;      }      Properties properties = (Properties)pd.getJavaProperties();      String nodeName = (String)properties.get("org.cougaar.node.name");      String hostName = (String)properties.get("org.cougaar.name.server");      java.util.List args = pd.getCommandLineArguments();      results.add(new NodeInfo(appServer, nodeName, hostName,                               processName,                               properties, args));    }    return results;  }