Set resultMBeans = null;
Set resultNames = null;
try
{
server = MBeanServerFactory.createMBeanServer();
instances.add(server.registerMBean(new Trivial(),
new ObjectName("MyDomain:description=Printer,type=laser")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("DefaultDomain:description=Printer,type=laser,date=1993")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("Socrates:description=Printer,type=laser,date=1993")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("DefaultDomain:description=Printer,type=ink")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("MyDomain:description=Disk,capacity=2")));
instances.add(server.registerMBean(new Trivial(),
new ObjectName("DefaultDomain:description=Disk,capacity=1")));
resultMBeans = server.queryMBeans(new ObjectName("*:*"), null);
resultNames = server.queryNames(new ObjectName("*:*"), null);
}
catch (Exception e)