} } else { if (isNode(name)) { newState(agentsOnNode(name), DEAD);
    public void enter(final String name) {      setExpiration(name, NEVER);      communityReady = false; // For ACME Community Ready Events      if (isSentinel()) {        if (isAgent(name)) {          int priorState = getPriorState(name);          if (priorState != DECONFLICT && priorState != RESTART) {            newState(name, DECONFLICT);          } else {            if (logger.isWarnEnabled()) {              logger.warn("Unexpected transition to DEAD state: agent=" + name +                          " priorState=" + stateName(getPriorState(name)));            }          }        } else { // a node          deadNodes.add(name);          if (!useGlobalSolver()) {            newState(agentsOnNode(name), DEAD);            removeFromCommunity(name);          } else {            if (agentsOnNode(name).size() > 0) {              getLayout(new LoadBalancerListener() {                public void layoutReady(Map layout) {                  if (getState(name) == DEAD) {                    if (logger.isInfoEnabled()) {                      logger.info("layout from EN4J: " + layout);                    }                    RestartDestinationLocator.setPreferredRestartLocations(                        layout);                    newState(agentsOnNode(name), DEAD);                    removeFromCommunity(name);                  } else { // Abort, node no longer classified as DEAD                    deadNodes.remove(name);                    if (logger.isInfoEnabled()) {                      logger.info("Restart aborted: node=" + name +                                  " state=" + stateName(getState(name)));                    }                  }                }              });            } else {              removeFromCommunity(name);            }          }        }      }      /*      if (isAgent(name) &&          isSentinel() &&          (getPriorState(name) == DefaultRobustnessController.ACTIVE ||          getPriorState(name) < INITIAL || getPriorState(name) == HEALTH_CHECK))      {        newState(name, DECONFLICT);      } else if (isNode(name)) {        deadNodes.add(name);        if (!useGlobalSolver()) {          newState(agentsOnNode(name), DEAD);          if (isSentinel()) { removeFromCommunity(name); }        } else {          if (isLeader(thisAgent)) {            if (agentsOnNode(name).size() > 0) {              getLayout(new LoadBalancerListener() {                public void layoutReady(Map layout) {                  if (getState(name) == DEAD) {                    if (logger.isInfoEnabled()) {                      logger.info("layout from EN4J: " + layout);                    }                    RestartDestinationLocator.setPreferredRestartLocations(layout);                    newState(agentsOnNode(name), DEAD);                    if (isSentinel()) {                      removeFromCommunity(name);                    }                  } else { // Abort, node no longer classified as DEAD                    deadNodes.remove(name);                    if (logger.isInfoEnabled()) {                      logger.info("Restart aborted: node=" + name +                                  " state=" + stateName(getState(name)));                    }                  }                }              });            } else {              removeFromCommunity(name);            }          } else {            newState(agentsOnNode(name), DEAD);          }        }      } else {        if (logger.isWarnEnabled()) {          logger.warn("Unexpected transition to DEAD state: agent=" + name +                      " priorState=" + stateName(getPriorState(name)));        }      }*/      if (isLocal(name)) {        stopHeartbeats(name);      }    }