MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName name;
try {
name = new ObjectName("org.easybatch.core.jmx:type=EasyBatchMonitorMBean");
if (!mbs.isRegistered(name)) {
easyBatchMonitor = new EasyBatchMonitor(easyBatchReport);
mbs.registerMBean(easyBatchMonitor, name);
LOGGER.info("Easy batch JMX MBean registered successfully as: " + name.getCanonicalName());
}
} catch (Exception e) {
String error = "Unable to register Easy batch JMX MBean. Root exception is :" + e.getMessage();