initial_members.notify();
initial_members.notifyAll();
    public void up(Event evt) {        Message msg, rsp_msg;        Object obj;        PingHeader hdr, rsp_hdr;        PingRsp rsp;        Address coord;        switch(evt.getType()) {            case Event.MSG:                msg=(Message)evt.getArg();                obj=msg.getHeader(getName());                if(obj == null || !(obj instanceof PingHeader)) {                    passUp(evt);                    return;                }                hdr=(PingHeader)msg.removeHeader(getName());                switch(hdr.type) {                    case PingHeader.GET_MBRS_REQ:   // return Rsp(local_addr, coord)                        // System.out.println("### GET_MBRS__REQ (local_addr=" + local_addr + "): is_server=" + is_server);                        if(!is_server) {                            return;                        }                        synchronized(members) {                            coord=members.size() > 0? (Address)members.firstElement() : local_addr;                        }                        PingRsp ping_rsp=new PingRsp(local_addr, coord);                        rsp_msg=new Message(msg.getSrc(), null, null);                        rsp_hdr=new PingHeader(PingHeader.GET_MBRS_RSP, ping_rsp);                        rsp_msg.putHeader(getName(), rsp_hdr);                         if(log.isTraceEnabled())                             log.trace("received GET_MBRS_REQ from " + msg.getSrc() + ", returning " + rsp_hdr);                        passDown(new Event(Event.MSG, rsp_msg));                        return;                    case PingHeader.GET_MBRS_RSP:   // add response to vector and notify waiting thread                        rsp=(PingRsp)hdr.arg;                        synchronized(initial_members) {                            if(log.isTraceEnabled())                                log.trace("received FIND_INITAL_MBRS_RSP, rsp=" + rsp);                            initial_members.addElement(rsp);                            initial_members.notify();                        }                        return;                    default:                        if(log.isWarnEnabled()) log.warn("got PING header with unknown type (" + hdr.type + ')');                        return;                }            case Event.SET_LOCAL_ADDRESS:                passUp(evt);                local_addr=(Address)evt.getArg();                // Add own address to initial_hosts if not present: we must always be able to ping ourself !                if(initial_hosts != null && local_addr != null) {                   List hlist;                   boolean inInitialHosts = false;                   for(Enumeration en=initial_hosts.elements(); en.hasMoreElements() && !inInitialHosts;) {                      hlist=(List)en.nextElement();                      if (hlist.contains(local_addr)) {                         inInitialHosts = true;                      }                                      }                    if (!inInitialHosts) {                        hlist = new List();                        hlist.add(local_addr);                        initial_hosts.add(hlist);                        if(log.isDebugEnabled())                            log.debug("[SET_LOCAL_ADDRESS]: adding my own address (" + local_addr +                                    ") to initial_hosts; initial_hosts=" + initial_hosts);                   }                }                break;            default:                passUp(evt);            // Pass up to the layer above us                break;        }    }