mirror of https://github.com/apache/activemq.git
added some more JMX stats
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@357195 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2c6156085c
commit
24389c4929
|
@ -115,6 +115,13 @@ public abstract class AbstractConnection implements Service, Connection, Task, C
|
|||
taskRunner = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of messages to be dispatched to this connection
|
||||
*/
|
||||
public int getDispatchQueueSize() {
|
||||
return dispatchQueue.size();
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
this.dispatch(connector.getBrokerInfo());
|
||||
}
|
||||
|
|
|
@ -36,7 +36,8 @@ public interface Connection extends Service {
|
|||
/**
|
||||
* Sends a message to the client.
|
||||
*
|
||||
* @param message the message to send to the client.
|
||||
* @param message
|
||||
* the message to send to the client.
|
||||
*/
|
||||
public void dispatchSync(Command message);
|
||||
|
||||
|
@ -47,9 +48,9 @@ public interface Connection extends Service {
|
|||
*/
|
||||
public void dispatchAsync(Command command);
|
||||
|
||||
|
||||
/**
|
||||
* Services a client command and submits it to the broker.
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
public Response service(Command command);
|
||||
|
@ -71,7 +72,6 @@ public interface Connection extends Service {
|
|||
*/
|
||||
public boolean isBlocked();
|
||||
|
||||
|
||||
/**
|
||||
* @return true if the Connection is connected
|
||||
*/
|
||||
|
@ -82,4 +82,8 @@ public interface Connection extends Service {
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/**
|
||||
* Returns the number of messages to be dispatched to this connection
|
||||
*/
|
||||
public int getDispatchQueueSize();
|
||||
}
|
||||
|
|
|
@ -66,4 +66,10 @@ public class ConnectionView implements ConnectionViewMBean {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of messages to be dispatched to this connection
|
||||
*/
|
||||
public int getDispatchQueueSize() {
|
||||
return connection.getDispatchQueueSize();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ public interface ConnectionViewMBean extends Service {
|
|||
*/
|
||||
public boolean isBlocked();
|
||||
|
||||
|
||||
/**
|
||||
* @return true if the Connection is connected
|
||||
*/
|
||||
|
@ -42,4 +41,8 @@ public interface ConnectionViewMBean extends Service {
|
|||
*/
|
||||
public boolean isActive();
|
||||
|
||||
/**
|
||||
* Returns the number of messages to be dispatched to this connection
|
||||
*/
|
||||
public int getDispatchQueueSize();
|
||||
}
|
|
@ -20,6 +20,7 @@ package org.activemq.broker.jmx;
|
|||
|
||||
import org.activemq.broker.Connector;
|
||||
import org.activemq.command.BrokerInfo;
|
||||
import org.activemq.command.RedeliveryPolicy;
|
||||
|
||||
public class ConnectorView implements ConnectorViewMBean {
|
||||
|
||||
|
@ -33,12 +34,61 @@ public class ConnectorView implements ConnectorViewMBean {
|
|||
connector.start();
|
||||
}
|
||||
|
||||
public String getBrokerName() {
|
||||
return getBrokerInfo().getBrokerName();
|
||||
}
|
||||
|
||||
public void stop() throws Exception {
|
||||
connector.stop();
|
||||
}
|
||||
|
||||
public String getBrokerURL() {
|
||||
return getBrokerInfo().getBrokerURL();
|
||||
}
|
||||
|
||||
public BrokerInfo getBrokerInfo() {
|
||||
return connector.getBrokerInfo();
|
||||
}
|
||||
|
||||
public short getBackOffMultiplier() {
|
||||
return getRedeliveryPolicy().getBackOffMultiplier();
|
||||
}
|
||||
|
||||
public long getInitialRedeliveryDelay() {
|
||||
return getRedeliveryPolicy().getInitialRedeliveryDelay();
|
||||
}
|
||||
|
||||
public int getMaximumRedeliveries() {
|
||||
return getRedeliveryPolicy().getMaximumRedeliveries();
|
||||
}
|
||||
|
||||
public boolean isUseExponentialBackOff() {
|
||||
return getRedeliveryPolicy().isUseExponentialBackOff();
|
||||
}
|
||||
|
||||
public void setBackOffMultiplier(short backOffMultiplier) {
|
||||
getRedeliveryPolicy().setBackOffMultiplier(backOffMultiplier);
|
||||
}
|
||||
|
||||
public void setInitialRedeliveryDelay(long initialRedeliveryDelay) {
|
||||
getRedeliveryPolicy().setInitialRedeliveryDelay(initialRedeliveryDelay);
|
||||
}
|
||||
|
||||
public void setMaximumRedeliveries(int maximumRedeliveries) {
|
||||
getRedeliveryPolicy().setMaximumRedeliveries(maximumRedeliveries);
|
||||
}
|
||||
|
||||
public void setUseExponentialBackOff(boolean useExponentialBackOff) {
|
||||
getRedeliveryPolicy().setUseExponentialBackOff(useExponentialBackOff);
|
||||
}
|
||||
|
||||
public RedeliveryPolicy getRedeliveryPolicy() {
|
||||
RedeliveryPolicy redeliveryPolicy = getBrokerInfo().getRedeliveryPolicy();
|
||||
if (redeliveryPolicy == null) {
|
||||
redeliveryPolicy = new RedeliveryPolicy();
|
||||
getBrokerInfo().setRedeliveryPolicy(redeliveryPolicy);
|
||||
}
|
||||
return redeliveryPolicy;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,9 +20,24 @@ package org.activemq.broker.jmx;
|
|||
|
||||
import org.activemq.Service;
|
||||
import org.activemq.command.BrokerInfo;
|
||||
import org.activemq.command.RedeliveryPolicy;
|
||||
|
||||
public interface ConnectorViewMBean extends Service {
|
||||
|
||||
public BrokerInfo getBrokerInfo();
|
||||
public short getBackOffMultiplier();
|
||||
|
||||
public long getInitialRedeliveryDelay();
|
||||
|
||||
public int getMaximumRedeliveries();
|
||||
|
||||
public boolean isUseExponentialBackOff();
|
||||
|
||||
public void setBackOffMultiplier(short backOffMultiplier);
|
||||
|
||||
public void setInitialRedeliveryDelay(long initialRedeliveryDelay);
|
||||
|
||||
public void setMaximumRedeliveries(int maximumRedeliveries);
|
||||
|
||||
public void setUseExponentialBackOff(boolean useExponentialBackOff);
|
||||
|
||||
}
|
Loading…
Reference in New Issue