public void stop() { stopDiagnostics(); if(bundler != null) { bundler.stop(); bundler=null; } if(msg_processing_policy != null) msg_processing_policy.destroy(); }
@ManagedOperation(description="Changes the message processing policy. The fully qualified name of a class " + "implementing MessageProcessingPolicy needs to be given") public void setMessageProcessingPolicy(String policy) { if(policy == null) return; if(policy.startsWith("submit")) { msg_processing_policy=new SubmitToThreadPool(); msg_processing_policy.init(this); return; } else if(policy.startsWith("max")) { msg_processing_policy=new MaxOneThreadPerSender(); msg_processing_policy.init(this); return; } try { Class<MessageProcessingPolicy> clazz=Util.loadClass(policy, getClass()); msg_processing_policy=clazz.newInstance(); message_processing_policy=policy; msg_processing_policy.init(this); } catch(Exception e) { log.error("failed setting message_processing_policy", e); } }
protected void flushQueue(final Map<Address,Message> queue) { if(queue.isEmpty()) return; for(Message msg: queue.values()) { boolean oob=msg.isFlagSet(Message.Flag.OOB), internal=msg.isFlagSet(Message.Flag.INTERNAL); transport.msg_processing_policy.process(msg, oob, internal); } queue.clear(); }
public void resetStats() { msg_stats.reset(); avg_batch_size.clear(); msg_processing_policy.reset(); }
protected void loopback(Message msg, final boolean multicast) { final Message copy=loopback_copy? msg.copy() : msg; if(is_trace) log.trace("%s: looping back message %s, headers are %s", local_addr, copy, copy.printHeaders()); if(!loopback_separate_thread) { passMessageUp(copy, null, false, multicast, false); return; } // changed to fix http://jira.jboss.com/jira/browse/JGRP-506 boolean internal=msg.isFlagSet(Message.Flag.INTERNAL); boolean oob=msg.isFlagSet(Message.Flag.OOB); // submitToThreadPool(() -> passMessageUp(copy, null, false, multicast, false), internal); msg_processing_policy.loopback(msg, oob, internal); }
public void resetStats() { msg_stats.reset(); avg_batch_size.clear(); msg_processing_policy.reset(); }
protected void loopback(Message msg, final boolean multicast) { final Message copy=loopback_copy? msg.copy() : msg; if(is_trace) log.trace("%s: looping back message %s, headers are %s", local_addr, copy, copy.printHeaders()); if(!loopback_separate_thread) { passMessageUp(copy, null, false, multicast, false); return; } // changed to fix http://jira.jboss.com/jira/browse/JGRP-506 boolean internal=msg.isFlagSet(Message.Flag.INTERNAL); boolean oob=msg.isFlagSet(Message.Flag.OOB); // submitToThreadPool(() -> passMessageUp(copy, null, false, multicast, false), internal); msg_processing_policy.loopback(msg, oob, internal); }
protected void processBatch(MessageBatch batch, boolean oob, boolean internal) { try { if(batch != null && !batch.isEmpty()) msg_processing_policy.process(batch, oob, internal); } catch(Throwable t) { log.error("processing batch failed", t); } }
setMessageProcessingPolicy(message_processing_policy); else msg_processing_policy.init(this);
public void stop() { stopDiagnostics(); if(bundler != null) { bundler.stop(); bundler=null; } if(msg_processing_policy != null) msg_processing_policy.destroy(); }
protected void handleSingleMessage(DataInput in, boolean multicast) { try { Message msg=new Message(false); // don't create headers, readFrom() will do this msg.readFrom(in); if(!multicast && unicastDestMismatch(msg.getDest())) return; boolean oob=msg.isFlagSet(Message.Flag.OOB), internal=msg.isFlagSet(Message.Flag.INTERNAL); msg_processing_policy.process(msg, oob, internal); } catch(Throwable t) { log.error(String.format(Util.getMessage("IncomingMsgFailure"), local_addr), t); } }
@ManagedOperation(description="Changes the message processing policy. The fully qualified name of a class " + "implementing MessageProcessingPolicy needs to be given") public void setMessageProcessingPolicy(String policy) { if(policy == null) return; if(policy.startsWith("submit")) { msg_processing_policy=new SubmitToThreadPool(); msg_processing_policy.init(this); return; } else if(policy.startsWith("max")) { msg_processing_policy=new MaxOneThreadPerSender(); msg_processing_policy.init(this); return; } try { Class<MessageProcessingPolicy> clazz=Util.loadClass(policy, getClass()); msg_processing_policy=clazz.newInstance(); message_processing_policy=policy; msg_processing_policy.init(this); } catch(Exception e) { log.error("failed setting message_processing_policy", e); } }
protected void flushQueue(final Map<Address,Message> queue) { if(queue.isEmpty()) return; for(Message msg: queue.values()) { boolean oob=msg.isFlagSet(Message.Flag.OOB), internal=msg.isFlagSet(Message.Flag.INTERNAL); transport.msg_processing_policy.process(msg, oob, internal); } queue.clear(); }
setMessageProcessingPolicy(message_processing_policy); else msg_processing_policy.init(this);
protected void processBatch(MessageBatch batch, boolean oob, boolean internal) { try { if(batch != null && !batch.isEmpty()) msg_processing_policy.process(batch, oob, internal); } catch(Throwable t) { log.error("processing batch failed", t); } }
protected void handleSingleMessage(DataInput in, boolean multicast) { try { Message msg=new Message(false); // don't create headers, readFrom() will do this msg.readFrom(in); if(!multicast && unicastDestMismatch(msg.getDest())) return; boolean oob=msg.isFlagSet(Message.Flag.OOB), internal=msg.isFlagSet(Message.Flag.INTERNAL); msg_processing_policy.process(msg, oob, internal); } catch(Throwable t) { log.error(String.format(Util.getMessage("IncomingMsgFailure"), local_addr), t); } }