activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r357195 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker: AbstractConnection.java Connection.java jmx/ConnectionView.java jmx/ConnectionViewMBean.java jmx/ConnectorView.java jmx/ConnectorViewMBean.java
Date Fri, 16 Dec 2005 17:48:42 GMT
Author: jstrachan
Date: Fri Dec 16 09:48:33 2005
New Revision: 357195

URL: http://svn.apache.org/viewcvs?rev=357195&view=rev
Log:
added some more JMX stats

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/AbstractConnection.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/Connection.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionView.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionViewMBean.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorView.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorViewMBean.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/AbstractConnection.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/AbstractConnection.java?rev=357195&r1=357194&r2=357195&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/AbstractConnection.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/AbstractConnection.java
Fri Dec 16 09:48:33 2005
@@ -115,6 +115,13 @@
             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());
     }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/Connection.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/Connection.java?rev=357195&r1=357194&r2=357195&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/Connection.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/Connection.java
Fri Dec 16 09:48:33 2005
@@ -1,21 +1,21 @@
 /**
-* <a href="http://activemq.org">ActiveMQ: The Open Source Message Fabric</a>
-*
-* Copyright 2005 (C) LogicBlaze, Inc. http://www.logicblaze.com
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-**/
+ * <a href="http://activemq.org">ActiveMQ: The Open Source Message Fabric</a>
+ *
+ * Copyright 2005 (C) LogicBlaze, Inc. http://www.logicblaze.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ **/
 package org.activemq.broker;
 
 import org.activemq.Service;
@@ -36,10 +36,11 @@
     /**
      * 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);
-    
+
     /**
      * Sends a message to the client.
      * 
@@ -47,39 +48,42 @@
      */
     public void dispatchAsync(Command command);
 
-
     /**
-     * Services a client command and submits it to the broker. 
+     * Services a client command and submits it to the broker.
+     * 
      * @param command
      */
     public Response service(Command command);
-    
+
     /**
      * Handles an unexpected error associated with a connection.
      * 
      * @param error
      */
     public void serviceException(Throwable error);
-    
+
     /**
      * @return true if the Connection is slow
      */
     public boolean isSlow();
-    
+
     /**
      * @return if after being marked, the Connection is still writing
      */
     public boolean isBlocked();
-    
-    
+
     /**
      * @return true if the Connection is connected
      */
     public boolean isConnected();
-    
+
     /**
      * @return true if the Connection is active
      */
     public boolean isActive();
 
+    /**
+     * Returns the number of messages to be dispatched to this connection
+     */
+    public int getDispatchQueueSize();
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionView.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionView.java?rev=357195&r1=357194&r2=357195&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionView.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionView.java
Fri Dec 16 09:48:33 2005
@@ -66,4 +66,10 @@
     }
     
 
+    /**
+     * Returns the number of messages to be dispatched to this connection
+     */
+    public int getDispatchQueueSize() {
+        return connection.getDispatchQueueSize();
+    }
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionViewMBean.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionViewMBean.java?rev=357195&r1=357194&r2=357195&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionViewMBean.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectionViewMBean.java
Fri Dec 16 09:48:33 2005
@@ -25,21 +25,24 @@
      * @return true if the Connection is slow
      */
     public boolean isSlow();
-    
+
     /**
      * @return if after being marked, the Connection is still writing
      */
     public boolean isBlocked();
-    
-    
+
     /**
      * @return true if the Connection is connected
      */
     public boolean isConnected();
-    
+
     /**
      * @return true if the Connection is active
      */
     public boolean isActive();
-    
+
+    /**
+     * Returns the number of messages to be dispatched to this connection
+     */
+    public int getDispatchQueueSize();
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorView.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorView.java?rev=357195&r1=357194&r2=357195&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorView.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorView.java
Fri Dec 16 09:48:33 2005
@@ -20,6 +20,7 @@
 
 import org.activemq.broker.Connector;
 import org.activemq.command.BrokerInfo;
+import org.activemq.command.RedeliveryPolicy;
 
 public class ConnectorView implements ConnectorViewMBean {
 
@@ -33,12 +34,61 @@
         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;
     }
 
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorViewMBean.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorViewMBean.java?rev=357195&r1=357194&r2=357195&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorViewMBean.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ConnectorViewMBean.java
Fri Dec 16 09:48:33 2005
@@ -20,9 +20,24 @@
 
 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);
 
 }



Mime
View raw message