protected void performForcedCheck() { //update all alive times Member[] members = super.getMembers(); for (int i = 0; members != null && i < members.length; i++) { if (memberAlive(members[i])) { if (membership.memberAlive((MemberImpl)members[i])) super.memberAdded(members[i]); addSuspects.remove(members[i]); } else { if (membership.getMember(members[i])!=null) { membership.removeMember((MemberImpl)members[i]); removeSuspects.remove(members[i]); if (members[i] instanceof StaticMember) { addSuspects.put(members[i], Long.valueOf(System.currentTimeMillis())); } super.memberDisappeared(members[i]); } } //end if } //for }
protected void performForcedCheck() { // update all alive times Member[] members = super.getMembers(); for (int i = 0; members != null && i < members.length; i++) { if (memberAlive(members[i])) { if (membership.memberAlive((MemberImpl) members[i])) super.memberAdded(members[i]); addSuspects.remove(members[i]); } else { if (membership.getMember(members[i]) != null) { membership.removeMember((MemberImpl) members[i]); removeSuspects.remove(members[i]); if (members[i] instanceof StaticMember) { addSuspects.put(members[i], Long.valueOf(System.currentTimeMillis())); } super.memberDisappeared(members[i]); } } // end if } // for }
@Override public void memberDisappeared(Member member) { if ( membership == null ) setupMembership(); boolean notify = false; boolean shutdown = Arrays.equals(member.getCommand(),Member.SHUTDOWN_PAYLOAD); if ( !shutdown ) if(log.isInfoEnabled()) log.info("Received memberDisappeared["+member+"] message. Will verify."); synchronized (membership) { if (!membership.contains(member)) { if(log.isInfoEnabled()) log.info("Verification complete. Member already disappeared["+member+"]"); return; } //check to see if the member really is gone //if the payload is not a shutdown message if (shutdown || !memberAlive(member)) { //not correct, we need to maintain the map membership.removeMember( (MemberImpl) member); removeSuspects.remove(member); if (member instanceof StaticMember) { addSuspects.put(member, Long.valueOf(System.currentTimeMillis())); } notify = true; } else { //add the member as suspect removeSuspects.put(member, Long.valueOf(System.currentTimeMillis())); } } if ( notify ) { if(log.isInfoEnabled()) log.info("Verification complete. Member disappeared["+member+"]"); super.memberDisappeared(member); } else { if(log.isInfoEnabled()) log.info("Verification complete. Member still alive["+member+"]"); } }
@Override public void memberDisappeared(Member member) { if ( membership == null ) setupMembership(); boolean notify = false; boolean shutdown = Arrays.equals(member.getCommand(),Member.SHUTDOWN_PAYLOAD); if (shutdown) { synchronized (membership) { if (!membership.contains(member)) return; membership.removeMember( (MemberImpl) member); removeSuspects.remove(member); if (member instanceof StaticMember) { addSuspects.put(member, Long.valueOf(System.currentTimeMillis())); } } super.memberDisappeared(member); } else { if(log.isInfoEnabled()) log.info("Received memberDisappeared["+member+"] message. Will verify."); synchronized (membership) { if (!membership.contains(member)) { if(log.isInfoEnabled()) log.info("Verification complete. Member already disappeared["+member+"]"); return; } //check to see if the member really is gone if (!memberAlive(member)) { //not correct, we need to maintain the map membership.removeMember( (MemberImpl) member); removeSuspects.remove(member); if (member instanceof StaticMember) { addSuspects.put(member, Long.valueOf(System.currentTimeMillis())); } notify = true; } else { //add the member as suspect removeSuspects.put(member, Long.valueOf(System.currentTimeMillis())); } } if ( notify ) { if(log.isInfoEnabled()) log.info("Verification complete. Member disappeared["+member+"]"); super.memberDisappeared(member); } else { if(log.isInfoEnabled()) log.info("Verification complete. Member still alive["+member+"]"); } } }
public void setLocalMember(Member member) { this.localMember = member; ((StaticMember)localMember).setLocal(true); }
@Override public void memberDisappeared(Member member) { if (membership == null) setupMembership(); boolean notify = false; boolean shutdown = Arrays.equals(member.getCommand(), Member.SHUTDOWN_PAYLOAD); if (shutdown) { synchronized (membership) { if (!membership.contains(member)) return; membership.removeMember((MemberImpl) member); removeSuspects.remove(member); if (member instanceof StaticMember) { addSuspects.put(member, Long.valueOf(System.currentTimeMillis())); } } super.memberDisappeared(member); } else { if (log.isInfoEnabled()) log.info("Received memberDisappeared[" + member + "] message. Will verify."); synchronized (membership) { if (!membership.contains(member)) { if (log.isInfoEnabled()) log.info("Verification complete. Member already disappeared[" + member + "]"); return; } // check to see if the member really is gone if (!memberAlive(member)) { // not correct, we need to maintain the map membership.removeMember((MemberImpl) member); removeSuspects.remove(member); if (member instanceof StaticMember) { addSuspects.put(member, Long.valueOf(System.currentTimeMillis())); } notify = true; } else { // add the member as suspect removeSuspects.put(member, Long.valueOf(System.currentTimeMillis())); } } if (notify) { if (log.isInfoEnabled()) log.info("Verification complete. Member disappeared[" + member + "]"); super.memberDisappeared(member); } else { if (log.isInfoEnabled()) log.info("Verification complete. Member still alive[" + member + "]"); } } }
public void setLocalMember(Member member) { this.localMember = member; ((StaticMember) localMember).setLocal(true); }
public void setPayload(byte[] payload) { this.payload = payload; ((StaticMember) membershipManager.getLocalMember()).setPayload(payload); }
public void setDomain(byte[] domain) { this.domain = domain; ((StaticMember) membershipManager.getLocalMember()).setDomain(domain); }