Пример #1
0
 /** Checks whether the potential_new_coord would be the new coordinator (2nd in line) */
 protected boolean wouldBeNewCoordinator(Address potential_new_coord) {
   if (potential_new_coord == null) return false;
   synchronized (members) {
     if (members.size() < 2) return false;
     Address new_coord = members.elementAt(1); // member at 2nd place
     return new_coord != null && new_coord.equals(potential_new_coord);
   }
 }
Пример #2
0
 protected Address determineCoordinator() {
   synchronized (members) {
     return members.size() > 0 ? members.elementAt(0) : null;
   }
 }
Пример #3
0
 @ManagedAttribute
 public int getNumMembers() {
   return members.size();
 }