MBeanServer server = MBeanServerFactory.createMBeanServer();
HtmlAdaptorServer html = new HtmlAdaptorServer();
try {
log.info("Registering HtmlAdaptorServer instance.");
server.registerMBean(html, new ObjectName("Adaptor:name=html,port=8082"));
log.info("Registering HierarchyDynamicMBean instance.");
HierarchyDynamicMBean hdm = new HierarchyDynamicMBean();
server.registerMBean(hdm, new ObjectName("log4j:hiearchy=default"));
} catch(Exception e) {
log.error("Problem while regitering MBeans instances.", e);
return;
}
html.start();