if (log.isInfoEnabled()) { log.info("Restarting agent: agent(s)=[" + agentSetToString(agents) + "], nodeName=" + nodeName); }
  private void restartAgents(Set agents, String nodeName) {    if (nodeName == null) {      log.warn("Unable to perform restart, no node selected: agents=[" +        agentSetToString(agents) + "]");    } else {      if (log.isInfoEnabled()) {        log.info("Restarting agent: agent(s)=[" +          agentSetToString(agents) + "], nodeName=" + nodeName);      }      for (Iterator it = agents.iterator(); it.hasNext();) {        MessageAddress agentAddr = (MessageAddress)it.next();        // Update agents status object        HealthStatus hs = getHealthStatus(agentAddr);        CougaarEvent.postComponentEvent(CougaarEventType.START,                                        getAgentIdentifier().toString(),                                        this.getClass().getName(),                                        "Restarting agent: agent=" + hs.getAgentId());        hs.setLastRestartAttempt(new Date());        hs.setState(HealthStatus.RESTART);        hs.setStatus(HealthStatus.DEAD);        bbs.publishChange(hs);        // add the AgentControl request        addAgent(agentAddr.toString(), nodeName);      }    }  }