if(log.isDebugEnabled()) { log.debug("name of request correlator header (" + hdr.corrName + ") is different from ours (" + name + "). Msg not accepted, passed up");
if(log.isTraceEnabled()) { log.trace("name of request correlator header (" + hdr.corrName + ") is different from ours (" + name + "). Msg not accepted, passed up");
    public boolean receiveMessage(Message msg) {        Object tmpHdr;        Header hdr;        RspCollector coll;        java.util.Stack stack;        java.util.List dests;        // i. If header is not an instance of request correlator header, ignore        //        // ii. Check whether the message was sent by a request correlator with        // the same name (there may be multiple request correlators in the same        // protocol stack...)        tmpHdr=msg.getHeader(name);        if(tmpHdr == null || !(tmpHdr instanceof Header)) {            return (true);        }        hdr=(Header)tmpHdr;        if(hdr.corrName == null || !hdr.corrName.equals(name)) {            if(log.isDebugEnabled()) {                log.debug("name of request correlator header (" +                        hdr.corrName + ") is different from ours (" + name + "). Msg not accepted, passed up");            }            return (true);        }        // If the header contains a destination list, and we are not part of it, then we discard the        // request (was addressed to other members)        dests=hdr.dest_mbrs;        if(dests != null && local_addr != null && !dests.contains(local_addr)) {            if(log.isDebugEnabled()) {                log.debug("discarded request from " + msg.getSrc() +                        " as we are not part of destination list (local_addr=" + local_addr + ", hdr=" + hdr + ')');            }            return false;        }        if(log.isTraceEnabled()) {            log.trace("header is " + hdr);        }        // [Header.REQ]:        // i. If there is no request handler, discard        // ii. Check whether priority: if synchronous and call stack contains        // address that equals local address -> add priority request. Else        // add normal request.        //        // [Header.RSP]:        // Remove the msg request correlator header and notify the associated        // <tt>RspCollector</tt> that a reply has been received        switch(hdr.type) {            case Header.REQ:                if(request_handler == null) {                    if(log.isWarnEnabled()) {                        log.warn("there is no request handler installed to deliver request !");                    }                    return (false);                }                if(deadlock_detection) {                    if(scheduler == null) {                        log.error("deadlock_detection is true, but scheduler is null: this is not supposed to happen" +                                  " (discarding request)");                        break;                    }                    Request req=new Request(msg);                    stack=hdr.callStack;                    if(hdr.rsp_expected && stack != null && local_addr != null) {                        if(stack.contains(local_addr)) {                            scheduler.addPrio(req);                            break;                        }                    }                    else {                        scheduler.add(req);                        break;                    }                }                handleRequest(msg);                break;            case Header.RSP:                msg.removeHeader(name);                coll=findEntry(hdr.id);                if(coll != null) {                    coll.receiveResponse(msg);                }                break;            default:                msg.removeHeader(name);                if(log.isErrorEnabled()) log.error("header's type is neither REQ nor RSP !");                break;        }        return (false);    }