if (isSentinel() && !isCoordinatorEnabled()) { coordinatorHelper = CoordinatorHelperFactory.getCoordinatorHelper(getBindingSite()); coordinatorHelper.addListener((DeconflictStateController)getController(DECONFLICT)); String enable = System.getProperty(DECONFLICTION, PROPERTY_ENABLED); if (enable.equalsIgnoreCase(PROPERTY_ENABLED)) { if (logger.isInfoEnabled()) { logger.info("Deconfliction enabled: community=" + model.getCommunityName()); } String allAgents[] = model.listEntries(CommunityStatusModel.AGENT); for (int i = 0; i < allAgents.length; i++) { coordinatorHelper.addAgent(allAgents[i]);
if (isSentinel()) { new DuplicateAgentDetector(model, getRestartHelper()); if (!isCoordinatorEnabled()) { coordinatorHelper = CoordinatorHelperFactory.getCoordinatorHelper( getBindingSite()); coordinatorHelper.addListener( (DeconflictStateController) getController(DECONFLICT)); String enable = System.getProperty(DECONFLICTION, PROPERTY_ENABLED); if (enable.equalsIgnoreCase(PROPERTY_ENABLED)) { if (logger.isInfoEnabled()) { logger.info("Deconfliction enabled: community=" + model.getCommunityName()); } String allAgents[] = model.listEntries(CommunityStatusModel.AGENT); for (int i = 0; i < allAgents.length; i++) { coordinatorHelper.addAgent(allAgents[i]); }
  public void leaderChange(String priorLeader, String newLeader) {    if (logger.isInfoEnabled()) {      logger.info("LeaderChange: prior=" + priorLeader + " new=" + newLeader);    }    if (isLeader(thisAgent) && model.getCurrentState(preferredLeader()) == DEAD) {      newState(preferredLeader(), RESTART);    }    checkCommunityReady();    if (didRestart && !suppressPingsOnRestart) {      newState(model.listEntries(model.AGENT, -1), HEALTH_CHECK);      newState(model.listEntries(model.NODE, -1), HEALTH_CHECK);    }    // Setup defense coordination    if (isSentinel() && !isCoordinatorEnabled()) {      coordinatorHelper = CoordinatorHelperFactory.getCoordinatorHelper(getBindingSite());      coordinatorHelper.addListener((DeconflictStateController)getController(DECONFLICT));      String enable = System.getProperty(DECONFLICTION, PROPERTY_ENABLED);      if (enable.equalsIgnoreCase(PROPERTY_ENABLED)) {        if (logger.isInfoEnabled()) {          logger.info("Deconfliction enabled: community=" + model.getCommunityName());        }        String allAgents[] = model.listEntries(CommunityStatusModel.AGENT);        for (int i = 0; i < allAgents.length; i++) {          coordinatorHelper.addAgent(allAgents[i]);        }      }    }  }