if(log.isInfoEnabled()) log.info("[NOT_MEMBER] I'm being shunned; exiting");
if(log.isDebugEnabled()) log.debug("[NOT_MEMBER] I'm being shunned; exiting");
    public void up(Event evt) {        Message msg;        FdHeader hdr=null;        Object sender, tmphdr;        switch(evt.getType()) {            case Event.SET_LOCAL_ADDRESS:                local_addr=(Address)evt.getArg();                break;            case Event.MSG:                msg=(Message)evt.getArg();                tmphdr=msg.getHeader(getName());                if(tmphdr == null || !(tmphdr instanceof FdHeader)) {                    if(ping_dest != null && (sender=msg.getSrc()) != null) {                        if(ping_dest.equals(sender)) {                            last_ack=System.currentTimeMillis();                            if(log.isTraceEnabled())                                log.trace("received msg from " + sender + " (counts as ack)");                            num_tries=0;                        }                    }                    break;  // message did not originate from FD layer, just pass up                }                hdr=(FdHeader)msg.removeHeader(getName());                switch(hdr.type) {                    case FdHeader.HEARTBEAT:                       // heartbeat request; send heartbeat ack                        Address hb_sender=msg.getSrc();                        Message hb_ack=new Message(msg.getSrc(), null, null);                        FdHeader tmp_hdr=new FdHeader(FdHeader.HEARTBEAT_ACK);                        // 1.  Send an ack                        tmp_hdr.from=local_addr;                        hb_ack.putHeader(getName(), tmp_hdr);                        passDown(new Event(Event.MSG, hb_ack));                        // 2. Shun the sender of a HEARTBEAT message if that sender is not a member. This will cause                        //    the sender to leave the group (and possibly rejoin it later)                        if(shun)                            shunInvalidHeartbeatSender(hb_sender);                        break;                                     // don't pass up !                    case FdHeader.HEARTBEAT_ACK:                   // heartbeat ack                        if(ping_dest != null && ping_dest.equals(hdr.from)) {                            last_ack=System.currentTimeMillis();                            num_tries=0;                            if(log.isInfoEnabled()) log.info("received ack from " + hdr.from);                        }                        else {                            stop();                            ping_dest=(Address)getPingDest(members);                            if(ping_dest != null) {                                try {                                    startMonitor();                                }                                catch(Exception ex) {                                    if(log.isWarnEnabled()) log.warn("exception when calling startMonitor(): " + ex);                                }                            }                        }                        break;                    case FdHeader.SUSPECT:                        if(hdr.mbrs != null) {                            if(log.isInfoEnabled()) log.info("[SUSPECT] suspect hdr is " + hdr);                            for(int i=0; i < hdr.mbrs.size(); i++) {                                Address m=(Address)hdr.mbrs.elementAt(i);                                if(local_addr != null && m.equals(local_addr)) {                                    if(log.isWarnEnabled())                                        log.warn("I was suspected, but will not remove myself from membership " +                                                "(waiting for EXIT message)");                                }                                else {                                    pingable_mbrs.remove(m);                                    ping_dest=(Address)getPingDest(pingable_mbrs);                                }                                passUp(new Event(Event.SUSPECT, m));                                passDown(new Event(Event.SUSPECT, m));                            }                        }                        break;                    case FdHeader.NOT_MEMBER:                        if(shun) {                            if(log.isInfoEnabled()) log.info("[NOT_MEMBER] I'm being shunned; exiting");                            passUp(new Event(Event.EXIT));                        }                        break;                }                return;        }        passUp(evt); // pass up to the layer above us    }