protected void sendToSingleMember(Address dest, byte[] buf, int offset, int length) throws Exception { Map<Address,SHARED_LOOPBACK> dests=routing_table.get(cluster_name); if(dests == null) { log.trace("no destination found for " + cluster_name); return; } SHARED_LOOPBACK target=dests.get(dest); if(target == null) { log.trace("destination address " + dest + " not found"); return; } target.receive(local_addr, buf, offset, length); }
public void sendMulticast(byte[] data, int offset, int length) throws Exception { Map<Address,SHARED_LOOPBACK> dests=routing_table.get(this.cluster_name); if(dests == null) { log.trace("no destination found for " + this.cluster_name); return; } for(Map.Entry<Address,SHARED_LOOPBACK> entry: dests.entrySet()) { Address dest=entry.getKey(); SHARED_LOOPBACK target=entry.getValue(); if(Objects.equals(local_addr, dest)) continue; // message was already looped back try { target.receive(local_addr, data, offset, length); } catch(Throwable t) { log.error(Util.getMessage("FailedSendingMessageTo") + dest, t); } } }
public void sendToSingleMember(Address dest, byte[] data, int offset, int length) throws Exception { Map<Address,SHARED_LOOPBACK> dests=routing_table.get(channel_name); if(dests == null) { if(log.isWarnEnabled()) log.warn("no destination found for " + channel_name); return; } SHARED_LOOPBACK target=dests.get(dest); if(target == null) { if(log.isWarnEnabled()) log.warn("destination address " + dest + " not found"); return; } target.receive(dest, local_addr, data, offset, length); }
public void sendToAllMembers(byte[] data, int offset, int length) throws Exception { Map<Address,SHARED_LOOPBACK> dests=routing_table.get(channel_name); if(dests == null) { if(log.isWarnEnabled()) log.warn("no destination found for " + channel_name); return; } for(Map.Entry<Address,SHARED_LOOPBACK> entry: dests.entrySet()) { Address dest=entry.getKey(); SHARED_LOOPBACK target=entry.getValue(); try { target.receive(dest, local_addr, data, offset, length); } catch(Throwable t) { log.error("failed sending message to " + dest, t); } } }
protected void sendToSingleMember(Address dest, byte[] buf, int offset, int length) throws Exception { Map<Address,SHARED_LOOPBACK> dests=routing_table.get(cluster_name); if(dests == null) { log.trace("no destination found for " + cluster_name); return; } SHARED_LOOPBACK target=dests.get(dest); if(target == null) { log.trace("destination address " + dest + " not found"); return; } target.receive(local_addr, buf, offset, length); }
public void sendMulticast(byte[] data, int offset, int length) throws Exception { Map<Address,SHARED_LOOPBACK> dests=routing_table.get(this.cluster_name); if(dests == null) { log.trace("no destination found for " + this.cluster_name); return; } for(Map.Entry<Address,SHARED_LOOPBACK> entry: dests.entrySet()) { Address dest=entry.getKey(); SHARED_LOOPBACK target=entry.getValue(); if(Objects.equals(local_addr, dest)) continue; // message was already looped back try { target.receive(local_addr, data, offset, length); } catch(Throwable t) { log.error(Util.getMessage("FailedSendingMessageTo") + dest, t); } } }