/** 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); } }
protected Address determineCoordinator() { synchronized (members) { return members.size() > 0 ? members.elementAt(0) : null; } }
@ManagedAttribute public int getNumMembers() { return members.size(); }