// Create the MBean for the top-level Server object
String domain = server.getDefaultDomain();
ManagedBean managed = registry.findManagedBean("StandardServer");
ModelMBean mm = managed.createMBean(tree);
mm.addAttributeChangeNotificationListener(demo, "shutdown", tree);
mm.addAttributeChangeNotificationListener(demo, "port", tree);
server.registerMBean(mm, createName(domain, tree));
// Create the MBean for each associated Service and friendes
Service services[] = tree.findServices();
for (int i = 0; i < services.length; i++) {