markNodeDead(nodeName);
RemoteProcess rp2 = null; synchronized (runningNodesLock) { rp2 = (RemoteProcess)runningNodes.get(nodeName); }           if (rp2 == null || stopping) { if (log.isInfoEnabled()) log.info("Remote Process must have just been killed by someone else, so it's OK - no need to mark it dead."); } else { if (log.isWarnEnabled()) log.warn("Remote Process for " + nodeName + " says it is not alive. Marking it dead."); markNodeDead(nodeName); }
  private void noticeIfServerDead() {    Enumeration nodeNames;    synchronized (runningNodesLock) {      nodeNames = runningNodes.keys();    }    while (nodeNames.hasMoreElements()) {      String nodeName = (String)nodeNames.nextElement();      NodeInfo ni = (NodeInfo)nodeToNodeInfo.get(nodeName);      if (ni == null)	continue;      if (ni.appServer == null) {	log.warn("Lost contact with AppServer on " + ni.hostName + " for node " + nodeName + " (null RemoteHost in NodeInfo). Assuming it is dead.");	markNodeDead(nodeName);	continue;      }      if (!appServerSupport.isValidRemoteHost(ni.appServer)) {	if (log.isWarnEnabled())	  log.warn("Lost contact with AppServer on " + ni.hostName + " for node " + nodeName + " (Marked as not valid remote host). Assuming it is dead.");	// Note - this could be a timeout, so don't do it	// so that it's not reversable	markNodeDead(nodeName, false);	continue;      }      RemoteProcess rp = null;      synchronized (runningNodesLock) {	rp = (RemoteProcess)runningNodes.get(nodeName);      }      if (rp == null) {	if (log.isWarnEnabled())	  log.warn("Remote process suddenly null for " + nodeName + ". Assuming it is dead.");	markNodeDead(nodeName);	continue;      }      try {	if (!rp.isAlive()) {	  if (log.isWarnEnabled())	    log.warn("Remote Process for " + nodeName + " says it is not alive. Marking it dead.");	  // FIXME: see if it's now not in runningNodes?	  // If so, a timing issue, and someone kill it...	  markNodeDead(nodeName);	  continue;	}      } catch (Exception e) {	// Todd W says this should never happen	if (log.isWarnEnabled())	  log.warn("Got exception trying to ask remote process for " + nodeName + " if it is alive. Marking it dead.", e);	markNodeDead(nodeName, false);	continue;      }    }  }