public Object up(Message msg) { StableHeader hdr=msg.getHeader(this.id); if(hdr == null) { handleRegularMessage(msg); return up_prot.up(msg); } handleUpEvent(hdr, msg.getSrc(), readDigest(msg.getRawBuffer(), msg.getOffset(), msg.getLength())); return null; // don't pass STABLE or STABILITY messages up the stack }
public void up(MessageBatch batch) { StableHeader hdr; for(Message msg: batch) { // remove and handle messages with flow control headers (STABLE_GOSSIP, STABILITY) if((hdr=msg.getHeader(id)) != null) { batch.remove(msg); handleUpEvent(hdr, batch.sender(), readDigest(msg.getRawBuffer(), msg.getOffset(), msg.getLength())); } } // only if message counting is on, and only for multicast messages (http://jira.jboss.com/jira/browse/JGRP-233) if(max_bytes > 0 && batch.dest() == null && !batch.isEmpty()) { boolean send_stable_msg=false; received.lock(); try { num_bytes_received+=batch.length(); if(num_bytes_received >= max_bytes) { log.trace("max_bytes has been reached (%s, bytes received=%s): triggers stable msg", max_bytes, num_bytes_received); num_bytes_received=0; send_stable_msg=true; } } finally { received.unlock(); } if(send_stable_msg) sendStableMessage(true); } if(!batch.isEmpty()) up_prot.up(batch); }
public Object up(Message msg) { StableHeader hdr=msg.getHeader(this.id); if(hdr == null) { handleRegularMessage(msg); return up_prot.up(msg); } handleUpEvent(hdr, msg.getSrc(), readDigest(msg.getRawBuffer(), msg.getOffset(), msg.getLength())); return null; // don't pass STABLE or STABILITY messages up the stack }
public void up(MessageBatch batch) { StableHeader hdr; for(Message msg: batch) { // remove and handle messages with flow control headers (STABLE_GOSSIP, STABILITY) if((hdr=msg.getHeader(id)) != null) { batch.remove(msg); handleUpEvent(hdr, batch.sender(), readDigest(msg.getRawBuffer(), msg.getOffset(), msg.getLength())); } } // only if message counting is on, and only for multicast messages (http://jira.jboss.com/jira/browse/JGRP-233) if(max_bytes > 0 && batch.dest() == null && !batch.isEmpty()) { boolean send_stable_msg=false; received.lock(); try { num_bytes_received+=batch.length(); if(num_bytes_received >= max_bytes) { log.trace("max_bytes has been reached (%s, bytes received=%s): triggers stable msg", max_bytes, num_bytes_received); num_bytes_received=0; send_stable_msg=true; } } finally { received.unlock(); } if(send_stable_msg) sendStableMessage(true); } if(!batch.isEmpty()) up_prot.up(batch); }