if (isLeader() && isAgent(name)) { String dest = getRestartLocation(); restartAgent(name, dest); RestartDestinationLocator.restartOneAgent(dest);
if (isLeader(thisAgent) && isAgent(name)) { String dest = RestartDestinationLocator.getRestartLocation(name); logger.info("Restart agent:" + " agent=" + name + " origin=" + getLocation(name) + " dest=" + dest); if (name != null && dest != null) { restartAgent(name, dest); RestartDestinationLocator.restartOneAgent(dest); } else { logger.error("Invalid restart parameter: " + " agent=" + name + " dest=" + dest);  if (name != null) { dest = getLocation(thisAgent); restartAgent(name, dest); RestartDestinationLocator.restartOneAgent(dest); } }
    public void enter(String name) {      if (isLeader() && isAgent(name)) {        String dest = getRestartLocation();        restartAgent(name, dest);        RestartDestinationLocator.restartOneAgent(dest);      }    }