/** * memberAdded gets invoked by the interceptor below the channel * and the channel will broadcast it to the membership listeners * @param member Member - the new member */ @Override public void memberAdded(Member member) { //notify upwards for (int i=0; i<membershipListeners.size(); i++ ) { MembershipListener membershipListener = (MembershipListener)membershipListeners.get(i); if (membershipListener != null) membershipListener.memberAdded(member); } }
/** * memberDisappeared gets invoked by the interceptor below the channel * and the channel will broadcast it to the membership listeners * @param member Member - the member that left or crashed */ @Override public void memberDisappeared(Member member) { //notify upwards for (int i=0; i<membershipListeners.size(); i++ ) { MembershipListener membershipListener = (MembershipListener)membershipListeners.get(i); if (membershipListener != null) membershipListener.memberDisappeared(member); } }
/** * Create a new mcast service impl * @param member - the local member * @param sendFrequency - the time (ms) in between pings sent out * @param expireTime - the time (ms) for a member to expire * @param port - the mcast port * @param bind - the bind address (not sure this is used yet) * @param mcastAddress - the mcast address * @param service - the callback service * @param localLoopbackDisabled - disable loopbackMode * @throws IOException */ public McastServiceImpl( MemberImpl member, long sendFrequency, long expireTime, int port, InetAddress bind, InetAddress mcastAddress, int ttl, int soTimeout, MembershipListener service, MessageListener msgservice, boolean localLoopbackDisabled) throws IOException { this.member = member; this.address = mcastAddress; this.port = port; this.mcastSoTimeout = soTimeout; this.mcastTTL = ttl; this.mcastBindAddress = bind; this.timeToExpiration = expireTime; this.service = service; this.msgservice = msgservice; this.sendFrequency = sendFrequency; this.localLoopbackDisabled = localLoopbackDisabled; init(); }
/** * memberAdded gets invoked by the interceptor below the channel and the * channel will broadcast it to the membership listeners * * @param member * Member - the new member */ @Override public void memberAdded(Member member) { // notify upwards for (int i = 0; i < membershipListeners.size(); i++) { MembershipListener membershipListener = (MembershipListener) membershipListeners.get(i); if (membershipListener != null) membershipListener.memberAdded(member); } }
/** * memberDisappeared gets invoked by the interceptor below the channel and * the channel will broadcast it to the membership listeners * * @param member * Member - the member that left or crashed */ @Override public void memberDisappeared(Member member) { // notify upwards for (int i = 0; i < membershipListeners.size(); i++) { MembershipListener membershipListener = (MembershipListener) membershipListeners.get(i); if (membershipListener != null) membershipListener.memberDisappeared(member); } }
/** * Adds a membership listener to the channel.<br> * Membership listeners are uniquely identified using the equals(Object) method * @param membershipListener MembershipListener */ @Override public void addMembershipListener(MembershipListener membershipListener) { if (!this.membershipListeners.contains(membershipListener) ) this.membershipListeners.add(membershipListener); }
/** * Removes a membership listener from the channel.<br> * Membership listeners are uniquely identified using the equals(Object) method * @param membershipListener MembershipListener */ @Override public void removeMembershipListener(MembershipListener membershipListener) { membershipListeners.remove(membershipListener); }
/** * Create a new mcast service impl * * @param member * - the local member * @param sendFrequency * - the time (ms) in between pings sent out * @param expireTime * - the time (ms) for a member to expire * @param port * - the mcast port * @param bind * - the bind address (not sure this is used yet) * @param mcastAddress * - the mcast address * @param service * - the callback service * @param localLoopbackDisabled * - disable loopbackMode * @throws IOException */ public McastServiceImpl(MemberImpl member, long sendFrequency, long expireTime, int port, InetAddress bind, InetAddress mcastAddress, int ttl, int soTimeout, MembershipListener service, MessageListener msgservice, boolean localLoopbackDisabled) throws IOException { this.member = member; this.address = mcastAddress; this.port = port; this.mcastSoTimeout = soTimeout; this.mcastTTL = ttl; this.mcastBindAddress = bind; this.timeToExpiration = expireTime; this.service = service; this.msgservice = msgservice; this.sendFrequency = sendFrequency; this.localLoopbackDisabled = localLoopbackDisabled; init(); }
public void setMembershipListener(MembershipListener membershipListener) { // Nothing to do }
/** * Add a membership listener, this version only supports one listener per service, * so calling this method twice will result in only the second listener being active. * @param listener The listener */ @Override public void setMembershipListener(MembershipListener listener) { this.listener = listener; }
/** * Adds a membership listener to the channel.<br> * Membership listeners are uniquely identified using the equals(Object) * method * * @param membershipListener * MembershipListener */ @Override public void addMembershipListener(MembershipListener membershipListener) { if (!this.membershipListeners.contains(membershipListener)) this.membershipListeners.add(membershipListener); }
/** * Removes a membership listener from the channel.<br> * Membership listeners are uniquely identified using the equals(Object) * method * * @param membershipListener * MembershipListener */ @Override public void removeMembershipListener(MembershipListener membershipListener) { membershipListeners.remove(membershipListener); }
/** * Add a membership listener, this version only supports one listener per * service, so calling this method twice will result in only the second * listener being active. * * @param listener * The listener */ @Override public void setMembershipListener(MembershipListener listener) { this.listener = listener; }