Attribute restartHostsAttr = new BasicAttribute("RestartHosts"); String specifiedRestartHosts = restartLocatorProps.getProperty("restartHosts"); if (specifiedRestartHosts != null && specifiedRestartHosts.trim().length() > 0) { StringTokenizer st = new  StringTokenizer(specifiedRestartHosts, " "); while (st.hasMoreTokens()) { restartHostsAttr.add(st.nextToken()); } ModificationItem mods[] = new ModificationItem[]{ new ModificationItem(DirContext.REPLACE_ATTRIBUTE, restartHostsAttr), };  communityService.modifyCommunityAttributes(communityToMonitor, mods);
Collection restartNodes = getSpecifiedNodes(); StringBuffer sb = new StringBuffer("["); for (Iterator it = restartNodes.iterator(); it.hasNext();) { sb.append((String)it.next()); sb.append(it.hasNext() ? "," : "]");
  private void updateParams(Properties props) {    communityToMonitor = props.getProperty("community");    String specifiedRestartNodes = restartLocatorProps.getProperty("restartNodes");    if (specifiedRestartNodes != null && specifiedRestartNodes.trim().length() > 0) {      Attribute restartNodesAttr = new BasicAttribute("RestartNode");      StringTokenizer st = new  StringTokenizer(specifiedRestartNodes, " ");      while (st.hasMoreTokens()) {        restartNodesAttr.add(st.nextToken());      }      ModificationItem mods[] = new ModificationItem[]{        new ModificationItem(DirContext.REPLACE_ATTRIBUTE, restartNodesAttr),      };      //communityService.modifyEntityAttributes(communityToMonitor, myAgent.toString(), mods);      communityService.modifyCommunityAttributes(communityToMonitor, mods);    }    Attribute restartHostsAttr = new BasicAttribute("RestartHosts");    String specifiedRestartHosts = restartLocatorProps.getProperty("restartHosts");    if (specifiedRestartHosts != null && specifiedRestartHosts.trim().length() > 0) {      StringTokenizer st = new  StringTokenizer(specifiedRestartHosts, " ");      while (st.hasMoreTokens()) {        restartHostsAttr.add(st.nextToken());      }      ModificationItem mods[] = new ModificationItem[]{        new ModificationItem(DirContext.REPLACE_ATTRIBUTE, restartHostsAttr),      };      //communityService.modifyEntityAttributes(communityToMonitor, myAgent.toString(), mods);      communityService.modifyCommunityAttributes(communityToMonitor, mods);    }    //log.debug("UpdateParams: " + myAttrs.size() +    //  " restartHosts=[" + specifiedRestartHosts +    //  "] restartNodes=[" + specifiedRestartNodes + "]");  }