activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1053886 - in /activemq/trunk: activemq-web-console/src/main/webapp/ activemq-web-console/src/main/webapp/decorators/ activemq-web/src/main/java/org/apache/activemq/web/
Date Thu, 30 Dec 2010 13:16:12 GMT
Author: dejanb
Date: Thu Dec 30 13:16:12 2010
New Revision: 1053886

URL: http://svn.apache.org/viewvc?rev=1053886&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3108 - network bridges in web console

Added:
    activemq/trunk/activemq-web-console/src/main/webapp/network.jsp
Modified:
    activemq/trunk/activemq-web-console/src/main/webapp/decorators/main.jsp
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacade.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java

Modified: activemq/trunk/activemq-web-console/src/main/webapp/decorators/main.jsp
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web-console/src/main/webapp/decorators/main.jsp?rev=1053886&r1=1053885&r2=1053886&view=diff
==============================================================================
--- activemq/trunk/activemq-web-console/src/main/webapp/decorators/main.jsp (original)
+++ activemq/trunk/activemq-web-console/src/main/webapp/decorators/main.jsp Thu Dec 30 13:16:12
2010
@@ -77,6 +77,8 @@
                             |
                             <a href="<c:url value='/connections.jsp'/>" title="Connections">Connections</a>
                             &#124;
+                            <a href="<c:url value='/network.jsp'/>" title="Network">Network</a>
+                            &#124;
  							<a href="<c:url value='/scheduled.jsp'/>" title="Scheduled">Scheduled</a>
                             &#124;
                             <a href="<c:url value='/send.jsp'/>"

Added: activemq/trunk/activemq-web-console/src/main/webapp/network.jsp
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web-console/src/main/webapp/network.jsp?rev=1053886&view=auto
==============================================================================
--- activemq/trunk/activemq-web-console/src/main/webapp/network.jsp (added)
+++ activemq/trunk/activemq-web-console/src/main/webapp/network.jsp Thu Dec 30 13:16:12 2010
@@ -0,0 +1,50 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+--%>
+<html>
+<head>
+<title>Network Bridges</title>
+</head>
+<body>
+
+<div style="margin-top: 5em">
+<h2>Network Bridges</h2>
+
+<table id="bridges" class="sortable autostripe">
+<thead>
+<tr>
+    <th>Remote Broker</th>
+    <th>Remote Address</th>
+    <th>Messages Enqueued</th>
+    <th>Messages Dequeued</th>
+</tr>
+</thead>
+<tbody>
+<c:forEach items="${requestContext.brokerQuery.networkBridges}" var="nb">
+<tr>
+	<td>${nb.remoteBrokerName}</td>
+	<td>${nb.remoteAddress}</td>
+	<td>${nb.enqueueCounter}</td>
+	<td>${nb.dequeueCounter}</td>
+</tr>
+</c:forEach>
+</tbody>
+</table>
+</div>
+
+</body>
+</html>
+

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacade.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacade.java?rev=1053886&r1=1053885&r2=1053886&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacade.java (original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacade.java Thu
Dec 30 13:16:12 2010
@@ -17,15 +17,8 @@
 package org.apache.activemq.web;
 
 import java.util.Collection;
-import org.apache.activemq.broker.jmx.BrokerViewMBean;
-import org.apache.activemq.broker.jmx.ConnectionViewMBean;
-import org.apache.activemq.broker.jmx.ConnectorViewMBean;
-import org.apache.activemq.broker.jmx.DurableSubscriptionViewMBean;
-import org.apache.activemq.broker.jmx.JobSchedulerViewMBean;
-import org.apache.activemq.broker.jmx.NetworkConnectorViewMBean;
-import org.apache.activemq.broker.jmx.QueueViewMBean;
-import org.apache.activemq.broker.jmx.SubscriptionViewMBean;
-import org.apache.activemq.broker.jmx.TopicViewMBean;
+
+import org.apache.activemq.broker.jmx.*;
 import org.apache.activemq.command.ActiveMQDestination;
 
 /**
@@ -163,7 +156,18 @@ public interface BrokerFacade {
 	 */
 	Collection<NetworkConnectorViewMBean> getNetworkConnectors()
 			throws Exception;
+
+
 	/**
+	 * The brokers network bridges.
+	 *
+	 * @return not <code>null</code>
+	 * @throws Exception
+	 */
+    Collection<NetworkBridgeViewMBean> getNetworkBridges()
+            throws Exception;
+
+    /**
 	 * Purges the given destination
 	 * 
 	 * @param destination

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java?rev=1053886&r1=1053885&r2=1053886&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java
(original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java
Thu Dec 30 13:16:12 2010
@@ -26,17 +26,8 @@ import javax.management.ObjectName;
 import javax.management.QueryExp;
 import javax.management.openmbean.CompositeData;
 import javax.management.openmbean.TabularData;
-import org.apache.activemq.broker.jmx.BrokerViewMBean;
-import org.apache.activemq.broker.jmx.ConnectionViewMBean;
-import org.apache.activemq.broker.jmx.ConnectorViewMBean;
-import org.apache.activemq.broker.jmx.DestinationViewMBean;
-import org.apache.activemq.broker.jmx.DurableSubscriptionViewMBean;
-import org.apache.activemq.broker.jmx.JobSchedulerViewMBean;
-import org.apache.activemq.broker.jmx.ManagementContext;
-import org.apache.activemq.broker.jmx.NetworkConnectorViewMBean;
-import org.apache.activemq.broker.jmx.QueueViewMBean;
-import org.apache.activemq.broker.jmx.SubscriptionViewMBean;
-import org.apache.activemq.broker.jmx.TopicViewMBean;
+
+import org.apache.activemq.broker.jmx.*;
 import org.springframework.util.StringUtils;
 
 /**
@@ -181,6 +172,14 @@ public abstract class BrokerFacadeSuppor
                 NetworkConnectorViewMBean.class);
     }
 
+    public Collection<NetworkBridgeViewMBean> getNetworkBridges() throws Exception
{
+        String brokerName = getBrokerName();
+        ObjectName query = new ObjectName("org.apache.activemq:BrokerName=" + brokerName
+ ",Type=NetworkBridge,*");
+        Set<ObjectName> queryResult = queryNames(query, null);
+        return getManagedObjects(queryResult.toArray(new ObjectName[queryResult.size()]),
+                NetworkBridgeViewMBean.class);
+    }
+
     @SuppressWarnings("unchecked")
     public Collection<SubscriptionViewMBean> getQueueConsumers(String queueName) throws
Exception {
         String brokerName = getBrokerName();



Mime
View raw message