}  try { rl.removeListener(s); } catch (Exception e) { if (log.isErrorEnabled()) { log.error("killListener: Exception killing listener for " + name + ": ", e);
try { rl.flushOutput(); } catch (Exception e) { if (log.isErrorEnabled()) { log.error("killListener: Exception flushing output for " + name + ": ", e); }
  private synchronized void killListenerWorker() {    Set names = nodeToAppServer.keySet();    for (Iterator i = names.iterator(); i.hasNext(); ) {      String name = (String)i.next();      AppServerDesc desc = (AppServerDesc)nodeToAppServer.get(name);      RemoteHost appServer = desc.appServer;      try {        RemoteProcess node = appServer.getRemoteProcess(name);        RemoteListenable rl = node.getRemoteListenable();        List listenerNames = rl.list();        for (int j = 0; j < listenerNames.size(); j++) {          String s = (String)listenerNames.get(j);          if (s.equals(CSMART.getNodeListenerId())) {	    if (log.isDebugEnabled()) {	      log.debug("Killing node listener: " + s +				 " for node: " + name);	    }	    try {	      rl.flushOutput();	    } catch (Exception e) {	      if (log.isErrorEnabled()) {		log.error("killListener: Exception flushing output for " + name + ": ", e);	      }	    }	    	    try {	      rl.removeListener(s);	    } catch (Exception e) {	      if (log.isErrorEnabled()) {		log.error("killListener: Exception killing listener for " + name + ": ", e);	      }	    }          }        }      } catch (Exception e) {        if (log.isErrorEnabled()) {          log.error("killListener: Exception getting listener for " + name + ": ", e);        }	// FIXME: Update the list of appservers here? -- but avoid sync problems      }    }  }