Set resultMBeans = null;
Set resultNames = null;
try
{
server = MBeanServerFactory.createMBeanServer("QueryMBeans");
instances.add(server.registerMBean(new Trivial(),
new ObjectName("123ADomain:type=instance1")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("321ADomain:type=instance2")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("2224ADomain:type=instance1")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("3ADomain:type=instance1")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("3ADomai123ADomain:type=instance1")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("ADomain:type=instance1")));
server.registerMBean(new Trivial(),
new ObjectName("Domain:type=instance1"));
server.registerMBean(new Trivial(),
new ObjectName("ADomai:type=instance1"));
server.registerMBean(new Trivial(),
new ObjectName("main:type=instance1"));
resultMBeans = server.queryMBeans(new ObjectName("*ADomain:*"), null);
resultNames = server.queryNames(new ObjectName("*ADomain:*"), null);
}
catch (Exception e)