package io.fabric8.api.jmx;

import javax.management.MBeanServer;
import javax.management.ObjectName;

/**
 * @author Stan Lewis
 */
public class JMXUtils {

    static void registerMBean(Object bean, MBeanServer mBeanServer, ObjectName objectName) throws Exception {
        if (!mBeanServer.isRegistered(objectName)) {
            mBeanServer.registerMBean(bean, objectName);
        } else {
            unregisterMBean(mBeanServer, objectName);
            mBeanServer.registerMBean(bean, objectName);
        }
    }

    static void unregisterMBean(MBeanServer mBeanServer, ObjectName objectName) throws Exception {
        if (mBeanServer.isRegistered(objectName)) {
            mBeanServer.unregisterMBean(objectName);
        }
    }

}

@@ -151,24 +151,31 @@
 tils %7B%0A%0A    
+public 
 static void 
@@ -527,16 +527,23 @@
  %7D%0A%0A    
+public 
 static v

make helper methods public so they can be more useful