queueChangeEvent( new CommunityStatusChangeEvent(CommunityStatusChangeEvent.STATE_CHANGE, se)); }
} else { logger.warn("setCurrentState: status entry not found, agent=" + name); }
  public void setCurrentState(String name, int state, long expiration) {    StatusEntry se = (StatusEntry)statusMap.get(name);    se.timestamp = now();    if (se.currentState != state) {      se.priorState = se.currentState;      se.currentState = state;      se.expiration = expiration;      logger.debug("setCurrentState" +                  " agent=" + name +                  " newState=" + se.currentState +                  " priorState=" + se.priorState +                  " expiration=" + expiration);      if (se.type == NODE) {         electLeader();      }      queueChangeEvent(        new CommunityStatusChangeEvent(CommunityStatusChangeEvent.STATE_CHANGE, se));      }  }