1 18 package org.apache.activemq.broker.jmx; 19 20 import org.apache.activemq.broker.Connector; 21 import org.apache.activemq.command.BrokerInfo; 22 23 public class ConnectorView implements ConnectorViewMBean { 24 25 private final Connector connector; 26 27 public ConnectorView(Connector connector) { 28 this.connector = connector; 29 } 30 31 public void start() throws Exception { 32 connector.start(); 33 } 34 35 public String getBrokerName() { 36 return getBrokerInfo().getBrokerName(); 37 } 38 39 public void stop() throws Exception { 40 connector.stop(); 41 } 42 43 public String getBrokerURL() { 44 return getBrokerInfo().getBrokerURL(); 45 } 46 47 public BrokerInfo getBrokerInfo() { 48 return connector.getBrokerInfo(); 49 } 50 51 54 public void resetStatistics() { 55 connector.getStatistics().reset(); 56 } 57 58 59 62 public void enableStatistics() { 63 connector.getStatistics().setEnabled(true); 64 } 65 66 69 public void disableStatistics() { 70 connector.getStatistics().setEnabled(false); 71 } 72 73 78 public boolean isStatisticsEnabled() { 79 return connector.getStatistics().isEnabled(); 80 } 81 82 87 public long getEnqueueCount() { 88 return connector.getStatistics().getEnqueues().getCount(); 89 90 } 91 92 97 public long getDequeueCount() { 98 return connector.getStatistics().getDequeues().getCount(); 99 } 100 101 } 102 | Popular Tags |