1 18 package org.apache.activemq.broker.jmx; 19 20 import org.apache.activemq.broker.Connection; 21 22 public class ConnectionView implements ConnectionViewMBean { 23 24 private final Connection connection; 25 26 public ConnectionView(Connection connection) { 27 this.connection = connection; 28 } 29 30 public void start() throws Exception { 31 connection.start(); 32 } 33 34 public void stop() throws Exception { 35 connection.stop(); 36 } 37 38 41 public boolean isSlow() { 42 return connection.isSlow(); 43 } 44 45 48 public boolean isBlocked() { 49 return connection.isBlocked(); 50 } 51 52 53 56 public boolean isConnected() { 57 return connection.isConnected(); 58 } 59 60 63 public boolean isActive() { 64 return connection.isActive(); 65 } 66 67 68 71 public int getDispatchQueueSize() { 72 return connection.getDispatchQueueSize(); 73 } 74 75 78 public void resetStatistics() { 79 connection.getStatistics().reset(); 80 } 81 82 87 public long getEnqueueCount() { 88 return connection.getStatistics().getEnqueues().getCount(); 89 90 } 91 92 97 public long getDequeueCount() { 98 return connection.getStatistics().getDequeues().getCount(); 99 } 100 101 public String getRemoteAddress() { 102 return connection.getRemoteAddress(); 103 } 104 105 public String getConnectionId() { 106 return connection.getConnectionId(); 107 } 108 109 } 110 | Popular Tags |