code: public static ObjectName registerMbean(String typeName, Object obj) {
          MBeanServer server = ManagementFactory.getPlatformMBeanServer();
          ObjectName name = JmxUtils.createObjectName(JmxUtils.getPackageName(obj.getClass()),
                                                      typeName);
          registerMbean(server, JmxUtils.createModelMBean(obj), name);
          return name;
      }
docs: Register the given object under the package name of the object's class
  with the given type name.
  
  this method using the platform mbean server as returned by
  ManagementFactory.getPlatformMBeanServer()
  
  @param typeName The name of the type to register
  @param obj The object to register as an mbean