NodeServesClient nsc = communitySupport.createNode(hostName, port, regName, nodeName, properties, args, listener, filter, configWriter);
HostServesClient hsc = communitySupport.getHost(hostName, port); NodeServesClient nsc = hsc.createNode(nodeName, properties, args, listener, filter, configWriter);
  private boolean createNode(NodeComponent nodeComponent,			     String nodeName, String hostName,			     ConfigurationWriter configWriter) {    DefaultStyledDocument doc = new DefaultStyledDocument();    JTextPane pane = new JTextPane(doc);    JScrollPane stdoutPane = new JScrollPane(pane);    // create a status button    JRadioButton statusButton = createStatusButton(nodeName);    // create a node event listener to get events from the node    NodeEventListener listener = null;    try {      listener = new ConsoleNodeListener(this,					 nodeComponent,					 getLogFileName(nodeName), 					 doc,					 statusButton);    } catch (Exception e) {      System.err.println("Unable to create output for: " + nodeName);      e.printStackTrace();      return false;    }    // set up idle chart    JCChart chart = new StripChart();    StripChartSource chartDataModel = new StripChartSource(chart);    ((StripChart)chart).init(chartDataModel);    ((ConsoleNodeListener)listener).setIdleChart(chart, chartDataModel);    charts.put(nodeName, chart);    // create node event filter with no buffering    // so that idle display is "smooth"    NodeEventFilter filter = new NodeEventFilter();    Properties properties = new Properties();    properties.put("org.cougaar.node.name", nodeName);    String nameServerPorts = "8888:5555";    properties.put("org.cougaar.tools.server.nameserver.ports", nameServerPorts);    properties.put("org.cougaar.name.server", 		   nameServerHostName + ":" + nameServerPorts);    String regName = DEFAULT_SERVER_NAME;    properties.put("org.cougaar.tools.server.name", DEFAULT_SERVER_NAME);    int port = 8484;    String[] args = new String[4];    args[0] = "-f";    args[1] = nodeName + ".ini";    args[2] = "-controlPort";    args[3] = Integer.toString(port);//     System.out.println("CSMARTConsole: creating node with:" + // 		       " Host: " + hostName + // 		       " Port: " + port +// 		       " Registry: " + regName +// 		       " Node: " + nodeName +// 		       " Args: " + args[0] +// 		       " Args: " + args[1] +// 		       " Args: " + args[2] +// 		       " Args: " + args[3] +// 		       " Listener: " + listener +// 		       " Filter: " + filter +// 		       " NodeComponent: " + nodeComponent);//     System.out.println(" Properties: ");//     properties.list(System.out);    // write the node component properties    try {      configWriter.writeConfigFiles(new File("."));    } catch (Exception e) {      JOptionPane.showMessageDialog(this,				    "Cannot write configuration on: " + 				    hostName +				    "; check that server is running");      e.printStackTrace();      return false;    }    // create the node    try {      // TODO: obtain most recent version of server and see if this works      //      HostServesClient hsc = communitySupport.createHost(hostName, port);      //      NodeServesClient nsc = hsc.createNode(nodeName, properties, args,       //					    listener, filter, configWriter);       NodeServesClient nsc =   	communitySupport.createNode(hostName, port, regName, 				    nodeName, properties, 				    args, listener, filter,  				    configWriter);      if (nsc != null)	runningNodes.put(nodeComponent, nsc);    } catch (Exception e) {       System.out.println("CSMARTConsole: cannot create node: " + nodeName);       JOptionPane.showMessageDialog(this,				     "Cannot create node on: " + hostName +				     "; check that server is running");       e.printStackTrace();       return false;    }        // only add gui controls if successfully created node    tabbedPane.add(nodeName, stdoutPane);    addStatusButton(statusButton);    updateExperimentControls(experiment, true);    startTimers();    return true;  }