git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1053886 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2010-12-30 13:16:12 +00:00
parent d0a1a001a3
commit ebcab0512c
4 changed files with 75 additions and 20 deletions

View File

@ -76,6 +76,8 @@
<a href="<c:url value='/subscribers.jsp'/>" title="Subscribers">Subscribers</a>
&#124;
<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;

View File

@ -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>

View File

@ -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

View File

@ -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 BrokerFacadeSupport implements BrokerFacade {
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();