ManagementContext.queryNames returns ObjectNames

This commit is contained in:
Ville Skyttä 2016-07-29 11:48:43 +03:00 committed by Clebert Suconic
parent adef9e4133
commit 29deb12ddb
3 changed files with 6 additions and 10 deletions

View File

@ -22,7 +22,6 @@ import static org.junit.Assume.assumeNotNull;
import java.net.MalformedURLException;
import java.util.Set;
import javax.management.ObjectInstance;
import javax.management.ObjectName;
import org.apache.activemq.broker.BrokerService;
@ -162,11 +161,10 @@ public class DuplexNetworkMBeanTest {
private void logAllMbeans(BrokerService broker) throws MalformedURLException {
try {
// trace all existing MBeans
Set<?> all = broker.getManagementContext().queryNames(null, null);
Set<ObjectName> all = broker.getManagementContext().queryNames(null, null);
LOG.info("Total MBean count=" + all.size());
for (Object o : all) {
ObjectInstance bean = (ObjectInstance) o;
LOG.info(bean.getObjectName().toString());
for (ObjectName on : all) {
LOG.info(on.toString());
}
}
catch (Exception ignored) {

View File

@ -161,11 +161,10 @@ public class DurableSubscriberWithNetworkRestartTest extends JmsMultipleBrokersT
private void logAllMbeans(BrokerService broker) throws MalformedURLException {
try {
// trace all existing MBeans
Set<?> all = broker.getManagementContext().queryNames(null, null);
Set<ObjectName> all = broker.getManagementContext().queryNames(null, null);
LOG.info("Total MBean count=" + all.size());
for (Object o : all) {
//ObjectInstance bean = (ObjectInstance)o;
LOG.info(o);
for (ObjectName on : all) {
LOG.info(on);
}
}
catch (Exception ignored) {

View File

@ -20,7 +20,6 @@ import javax.jms.InvalidSelectorException;
import javax.jms.Session;
import javax.jms.TopicConnection;
import javax.jms.TopicSession;
import javax.naming.InitialContext;
import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport;
import org.junit.Test;