code: static public ObjectName registerMBean(final String serviceName, 
  		  							final String nameName,
  		  							final Object theMbean) {
      final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
      ObjectName name = getMBeanName(serviceName, nameName);
      try {
        mbs.registerMBean(theMbean, name);
        return name;
      } catch (InstanceAlreadyExistsException ie) {
        // Ignore if instance already exists 
      } catch (Exception e) {
        e.printStackTrace();
      }
      return null;
    }
docs: Register the MBean using our standard MBeanName format
  "hadoop:service=<serviceName>,name=<nameName>"
  Where the <serviceName> and <nameName> are the supplied parameters
  
  @param serviceName
  @param nameName
  @param theMbean - the MBean to register
  @return the named used to register the MBean