docs: static boolean registerMBean(Object mbean, String name) {
          try {
              MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
              synchronized (mbs) {
                  ObjectName objName = new ObjectName(name);
                  if (mbs.isRegistered(objName)) {
                      mbs.unregisterMBean(objName);
                  }
                  mbs.registerMBean(mbean, objName);
              }
              return true;
          } catch (Exception e) {
              e.printStackTrace();
          }
          return false;
      }