public void down(Event evt) {
PbcastHeader hdr;
Message m, copy;
View v;
Vector mbrs;
Address key;
NakReceiverWindow win;
switch(evt.getType()) {
case Event.MSG:
m=(Message) evt.getArg();
if(m.getDest() != null && !m.getDest().isMulticastAddress()) {
break; // unicast address: not null and not mcast, pass down unchanged
}
else { // multicast address
hdr=new PbcastHeader(PbcastHeader.MCAST_MSG, seqno);
m.putHeader(getName(), hdr);
// put message in NakReceiverWindow (to be on the safe side if we don't receive it ...)
synchronized(digest) {
win=(NakReceiverWindow) digest.get(local_addr);
if(win == null) {
if(log.isInfoEnabled()) log.info("NakReceiverWindow for sender " + local_addr +
" not found. Creating new NakReceiverWindow starting at seqno=" + seqno);
win=new NakReceiverWindow(local_addr, seqno);
digest.put(local_addr, win);
}
copy=m.copy();
copy.setSrc(local_addr);
win.add(seqno, copy);
}
seqno++;
break;
}
case Event.SET_DIGEST:
setDigest((Digest) evt.getArg());
return; // don't pass down
case Event.GET_DIGEST: // don't pass down
passUp(new Event(Event.GET_DIGEST_OK, getDigest()));
return;
case Event.GET_DIGEST_STATE: // don't pass down
passUp(new Event(Event.GET_DIGEST_STATE_OK, getDigest()));
return;
case Event.VIEW_CHANGE:
v=(View) evt.getArg();
if(v == null) {
if(log.isErrorEnabled()) log.error("view is null !");
break;
}
mbrs=v.getMembers();
// update internal membership list
synchronized(members) {
members.removeAllElements();
for(int i=0; i < mbrs.size(); i++)