for(Iterator<Address> it=new_mbrs.iterator(); it.hasNext();) {
Address mbr=it.next();
if(gms.members.contains(mbr)) { // already joined: return current digest and membership
if(log.isWarnEnabled())
log.warn(mbr + " already present; returning existing view " + gms.view);
JoinRsp join_rsp=new JoinRsp(new View(gms.view_id, gms.members.getMembers()), gms.getDigest());
gms.sendJoinResponse(join_rsp, mbr);
it.remove();
}
}
if(new_mbrs.isEmpty() && leaving_mbrs.isEmpty() && suspected_mbrs.isEmpty()) {
if(log.isTraceEnabled())
log.trace("found no members to add or remove, will not create new view");
return;
}
View new_view=gms.getNextView(new_mbrs, leaving_mbrs, suspected_mbrs);
if(new_view.size() == 0 && gms.local_addr != null && gms.local_addr.equals(new_view.getCreator())) {
if(log.isTraceEnabled())
log.trace("view " + new_view + " is empty: will not multicast it (last view)");
if(leaving) {
gms.initState(); // in case connect() is called again
}