protected void passMessageUp(Message msg, AsciiString cluster_name, boolean perform_cluster_name_matching,
boolean multicast, boolean discard_own_mcast) {
if(log.isTraceEnabled())
log.trace("%s: received %s, headers are %s", local_addr, msg, msg.printHeaders());
final Protocol tmp_prot=isSingleton()? up_prots.get(cluster_name) : up_prot;
if(tmp_prot == null)
return;
boolean is_protocol_adapter=tmp_prot instanceof ProtocolAdapter;
// Discard if message's cluster name is not the same as our cluster name
if(!is_protocol_adapter && perform_cluster_name_matching && this.cluster_name != null && !this.cluster_name.equals(cluster_name)) {
if(log_discard_msgs && log.isWarnEnabled()) {
Address sender=msg.getSrc();
if(suppress_log_different_cluster != null)
suppress_log_different_cluster.log(SuppressLog.Level.warn, sender,
suppress_time_different_cluster_warnings,
cluster_name,this.cluster_name, sender);
else
log.warn(Util.getMessage("MsgDroppedDiffCluster"), cluster_name,this.cluster_name, sender);
}
return;
}
if(multicast && discard_own_mcast) {
Address local=is_protocol_adapter? ((ProtocolAdapter)tmp_prot).getAddress() : local_addr;
if(local != null && local.equals(msg.getSrc()))
return;
}
tmp_prot.up(new Event(Event.MSG, msg));
}