1 18 19 package org.apache.activemq.broker.region; 20 21 22 import org.apache.activemq.management.CountStatisticImpl; 23 import org.apache.activemq.management.StatsImpl; 24 25 30 public class ConnectionStatistics extends StatsImpl { 31 32 private CountStatisticImpl enqueues; 33 private CountStatisticImpl dequeues; 34 35 public ConnectionStatistics() { 36 37 enqueues = new CountStatisticImpl("enqueues", "The number of messages that have been sent to the connection"); 38 dequeues = new CountStatisticImpl("dequeues", "The number of messages that have been dispatched from the connection"); 39 40 addStatistic("enqueues", enqueues); 41 addStatistic("dequeues", dequeues); 42 } 43 44 public CountStatisticImpl getEnqueues() { 45 return enqueues; 46 } 47 48 public CountStatisticImpl getDequeues() { 49 return dequeues; 50 } 51 52 public void reset() { 53 super.reset(); 54 enqueues.reset(); 55 dequeues.reset(); 56 } 57 58 public void setEnabled(boolean enabled) { 59 super.setEnabled(enabled); 60 enqueues.setEnabled(enabled); 61 dequeues.setEnabled(enabled); 62 } 63 64 public void setParent(ConnectorStatistics parent) { 65 if (parent != null) { 66 enqueues.setParent(parent.getEnqueues()); 67 dequeues.setParent(parent.getDequeues()); 68 } 69 else { 70 enqueues.setParent(null); 71 dequeues.setParent(null); 72 } 73 } 74 75 76 } 77 | Popular Tags |