@Override
protected final void registerChildren() {
super.registerChildren();
//System.out.println("Registering children of DomainRoot");
final ObjectName self = getObjectName();
final ObjectNameBuilder objectNames =
new ObjectNameBuilder(getMBeanServer(), self);
ObjectName childObjectName = null;
Object mbean = null;
final MBeanServer server = getMBeanServer();
/**
Follow this order: some later MBeans might depend on others.
*/
childObjectName = objectNames.buildChildObjectName(Pathnames.class);
mbean = new PathnamesImpl(self);
registerChild(mbean, childObjectName);
childObjectName = objectNames.buildChildObjectName(Query.class);
mbean = new QueryMgrImpl(self);
registerChild(mbean, childObjectName);
childObjectName = objectNames.buildChildObjectName(Logging.class);
mbean = new LoggingImpl(self, "server");
registerChild(mbean, childObjectName);
childObjectName = objectNames.buildChildObjectName(Tools.class);
mbean = new ToolsImpl(self);
registerChild(mbean, childObjectName);
childObjectName = objectNames.buildChildObjectName(BulkAccess.class);
mbean = new BulkAccessImpl(self);
registerChild(mbean, childObjectName);
childObjectName = objectNames.buildChildObjectName(Sample.class);
mbean = new SampleImpl(self);
registerChild(mbean, childObjectName);
childObjectName = objectNames.buildChildObjectName(RuntimeRoot.class);
mbean = new RuntimeRootImpl(self);
registerChild(mbean, childObjectName);
// after registering Ext, other MBeans can depend on the above ones egs Paths, Query
childObjectName = objectNames.buildChildObjectName(Ext.class);
final ObjectName extObjectName = childObjectName;
mbean = new ExtImpl(self);
registerChild(mbean, childObjectName);
childObjectName = objectNames.buildChildObjectName(server, extObjectName, Realms.class);
mbean = new RealmsImpl(extObjectName);
registerChild(mbean, childObjectName);
// Monitoring MBeans can rely on all the prior MBeans
childObjectName = objectNames.buildChildObjectName(MonitoringRoot.class);
mbean = new MonitoringRootImpl(self);
registerChild(mbean, childObjectName);
}