if(stub == null)
if(stub == null) {
    void handleDownEvent(Event evt) {        switch(evt.getType()) {            case Event.TMP_VIEW:            case Event.VIEW_CHANGE:                synchronized(members) {                    members.removeAllElements();                    Vector tmpvec=((View)evt.getArg()).getMembers();                    for(int i=0; i < tmpvec.size(); i++)                        members.addElement(tmpvec.elementAt(i));                }                break;            case Event.GET_LOCAL_ADDRESS:   // return local address -> Event(SET_LOCAL_ADDRESS, local)                passUp(new Event(Event.SET_LOCAL_ADDRESS, local_addr));                break;            case Event.SET_LOCAL_ADDRESS:                local_addr=(Address)evt.getArg();                break;            case Event.CONNECT:                channel_name=(String)evt.getArg();                if(stub == null)                    if(log.isErrorEnabled()) log.error("CONNECT:  router stub is null!");                else {                    stub.register(channel_name);                }                receiver=new Thread(this, "TUNNEL receiver thread");                receiver.setDaemon(true);                receiver.start();                passUp(new Event(Event.CONNECT_OK));                break;            case Event.DISCONNECT:                if(receiver != null) {                    receiver=null;                    if(stub != null)                        stub.disconnect();                }                teardownTunnel();                passUp(new Event(Event.DISCONNECT_OK));                passUp(new Event(Event.SET_LOCAL_ADDRESS, null));                break;            case Event.ACK:                passUp(new Event(Event.ACK_OK));                break;        }    }