AbstractMBeanServerExecutor implements MBeanServerExecutor, NotificationListener { public Set<ObjectName> queryNames(ObjectName pObjectName) throws IOException { Set<ObjectName> names = new LinkedHashSet<ObjectName>(); for (MBeanServerConnection server : getMBeanServers()) { names.addAll(server.queryNames(pObjectName,null)); } return names; }  void each(ObjectName pObjectName, MBeanEachCallback pCallback); T call(ObjectName pObjectName, MBeanAction<T> pMBeanAction, Object ... pExtraArgs); Set<ObjectName> queryNames(ObjectName pObjectName); void unregisterFromMBeanNotifications(); void handleNotification(Notification pNotification, Object pHandback); boolean hasMBeansListChangedSince(long pTimestamp);  }
@Test public void queryNames() throws IOException, MalformedObjectNameException, NotCompliantMBeanException, InstanceAlreadyExistsException, MBeanRegistrationException { Set<ObjectName> names = executor.queryNames(null); assertTrue(names.contains(new ObjectName("test:type=one"))); assertTrue(names.contains(new ObjectName("test:type=two"))); assertEquals(names.size(), 3); }