log.error("don't recognize request with type=" + req.type);
System.err.println("don't recognize request with type=" + req.type);
        public void onMessage(Message message) {            Request req;            if(message instanceof ObjectMessage) {                req=(Request)message;                switch(req.type) {                    case Request.DISCOVERY_REQ:                        Request rsp=new Request(Request.NEW_MEMBER, local_addr);                        ObjectMessage msg=null;                        try {                            msg=session.createObjectMessage(rsp);                            pub.publish(msg);                        }                        catch(JMSException e) {                            e.printStackTrace();                        }                        break;                    case Request.NEW_MEMBER:                        IpAddress new_mbr=(IpAddress)req.arg;                        if(!members.contains(new_mbr)) {                            members.add(new_mbr);                            System.out.println("-- discovered " + new_mbr);                            if(members.size() >= num_members) {                                System.out.println("-- all members have joined (" + members + ')');                                running=false;                                synchronized(this) {                                    if(sub != null) {                                        try {                                            sub.setMessageListener(null);                                        }                                        catch(JMSException e) {                                            e.printStackTrace();                                        }                                    }                                    this.notifyAll();                                }                                break;                            }                        }                        break;                    default:                        log.error("don't recognize request with type=" + req.type);                        break;                }            }        }