mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4237 - web console - connectors and connections
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1430252 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
da4302921e
commit
4cbd91d494
|
@ -120,12 +120,12 @@ public abstract class BrokerFacadeSupport implements BrokerFacade {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Collection<String> getConnections(String connectorName) throws Exception {
|
public Collection<String> getConnections(String connectorName) throws Exception {
|
||||||
String brokerName = getBrokerName();
|
String brokerName = getBrokerName();
|
||||||
ObjectName query = new ObjectName("org.apache.activemq:BrokerName=" + brokerName
|
ObjectName query = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + brokerName
|
||||||
+ ",Type=Connection,ConnectorName=" + connectorName + ",Connection=*");
|
+ ",connector=clientConnectors,connectorName=" + connectorName + ",connectionName=*");
|
||||||
Set<ObjectName> queryResult = queryNames(query, null);
|
Set<ObjectName> queryResult = queryNames(query, null);
|
||||||
Collection<String> result = new ArrayList<String>(queryResult.size());
|
Collection<String> result = new ArrayList<String>(queryResult.size());
|
||||||
for (ObjectName on : queryResult) {
|
for (ObjectName on : queryResult) {
|
||||||
String name = StringUtils.replace(on.getKeyProperty("Connection"), "_", ":");
|
String name = StringUtils.replace(on.getKeyProperty("connectionName"), "_", ":");
|
||||||
result.add(name);
|
result.add(name);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -135,8 +135,8 @@ public abstract class BrokerFacadeSupport implements BrokerFacade {
|
||||||
public ConnectionViewMBean getConnection(String connectionName) throws Exception {
|
public ConnectionViewMBean getConnection(String connectionName) throws Exception {
|
||||||
connectionName = StringUtils.replace(connectionName, ":", "_");
|
connectionName = StringUtils.replace(connectionName, ":", "_");
|
||||||
String brokerName = getBrokerName();
|
String brokerName = getBrokerName();
|
||||||
ObjectName query = new ObjectName("org.apache.activemq:BrokerName=" + brokerName
|
ObjectName query = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + brokerName
|
||||||
+ ",Type=Connection,*,Connection=" + connectionName);
|
+ ",connector=clientConnectors,*,connectionName=" + connectionName);
|
||||||
Set<ObjectName> queryResult = queryNames(query, null);
|
Set<ObjectName> queryResult = queryNames(query, null);
|
||||||
if (queryResult.size() == 0)
|
if (queryResult.size() == 0)
|
||||||
return null;
|
return null;
|
||||||
|
@ -148,18 +148,18 @@ public abstract class BrokerFacadeSupport implements BrokerFacade {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Collection<String> getConnectors() throws Exception {
|
public Collection<String> getConnectors() throws Exception {
|
||||||
String brokerName = getBrokerName();
|
String brokerName = getBrokerName();
|
||||||
ObjectName query = new ObjectName("org.apache.activemq:BrokerName=" + brokerName + ",Type=Connector,*");
|
ObjectName query = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + brokerName + ",connector=clientConnectors,connectorName=*");
|
||||||
Set<ObjectName> queryResult = queryNames(query, null);
|
Set<ObjectName> queryResult = queryNames(query, null);
|
||||||
Collection<String> result = new ArrayList<String>(queryResult.size());
|
Collection<String> result = new ArrayList<String>(queryResult.size());
|
||||||
for (ObjectName on : queryResult)
|
for (ObjectName on : queryResult)
|
||||||
result.add(on.getKeyProperty("ConnectorName"));
|
result.add(on.getKeyProperty("connectorName"));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConnectorViewMBean getConnector(String name) throws Exception {
|
public ConnectorViewMBean getConnector(String name) throws Exception {
|
||||||
String brokerName = getBrokerName();
|
String brokerName = getBrokerName();
|
||||||
ObjectName objectName = new ObjectName("org.apache.activemq:BrokerName=" + brokerName
|
ObjectName objectName = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + brokerName
|
||||||
+ ",Type=Connector,ConnectorName=" + name);
|
+ ",connector=clientConnectors,connectorName=" + name);
|
||||||
return (ConnectorViewMBean) newProxyInstance(objectName, ConnectorViewMBean.class, true);
|
return (ConnectorViewMBean) newProxyInstance(objectName, ConnectorViewMBean.class, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue