Example #1
0
 private boolean elected(Set<Node> candidates) {
   int size = candidates.size();
   if (size < this.quorum) {
     ClusteringServerLogger.ROOT_LOGGER.quorumNotReached(
         this.singletonServiceName.getCanonicalName(), this.quorum);
     return false;
   } else if (size == this.quorum) {
     ClusteringServerLogger.ROOT_LOGGER.quorumJustReached(
         this.singletonServiceName.getCanonicalName(), this.quorum);
   }
   Node elected = this.election(candidates);
   if (elected != null) {
     ClusteringServerLogger.ROOT_LOGGER.elected(
         elected.getName(), this.singletonServiceName.getCanonicalName());
   }
   return (elected != null) ? elected.equals(this.group.getValue().getLocalNode()) : false;
 }