/** Checks if a message should be passed up, or not */ protected boolean shouldDropUpMessage( @SuppressWarnings("UnusedParameters") Message msg, Address sender) { if (discard_all && !sender.equals(localAddress())) return true; if (ignoredMembers.contains(sender)) { if (log.isTraceEnabled()) log.trace(localAddress + ": dropping message from " + sender); num_up++; return true; } if (up > 0) { double r = Math.random(); if (r < up) { if (excludeItself && sender.equals(localAddress())) { if (log.isTraceEnabled()) log.trace("excluding myself"); } else { if (log.isTraceEnabled()) log.trace(localAddress + ": dropping message from " + sender); num_up++; return true; } } } return false; }
public DISCARD removeIgnoredMember(Address member) { ignoredMembers.remove(member); return this; }
public DISCARD resetIgnoredMembers() { ignoredMembers.clear(); return this; }
/** Messages from this sender will get dropped */ public DISCARD addIgnoreMember(Address sender) { ignoredMembers.add(sender); return this; }