code: private ObjectName registerMXBean(MBeanServer pServer, Object pObject, Class pManagementInterface, String pName) throws MalformedObjectNameException, NotCompliantMBeanException, InstanceAlreadyExistsException, MBeanRegistrationException {
          ObjectName objectName = new ObjectName(pName);
          final StandardMBean mxBean = new StandardMBean(pObject, pManagementInterface, true /* MXBean */);
          pServer.registerMBean(mxBean, objectName);
          System.out.println("Registered MXBean " + objectName);
          return objectName;
      }
docs: See https://community.jboss.org/thread/167796 for details