package org.opendaylight.controller.md.sal.common.util.jmx;
+import com.google.common.annotations.Beta;
import java.lang.management.ManagementFactory;
-
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.annotations.Beta;
-
/**
* Abstract base for an MXBean implementation class.
* <p>
return new ObjectName(builder.toString());
}
+ /**
+ * This method is a wrapper for registerMBean with void return type so it can be invoked by dependency
+ * injection frameworks such as Spring and Blueprint.
+ */
+ public void register() {
+ registerMBean();
+ }
+
/**
* Registers this bean with the platform MBean server with the domain defined by
* {@link #BASE_JMX_PREFIX}.
return registered;
}
+ /**
+ * This method is a wrapper for unregisterMBean with void return type so it can be invoked by dependency
+ * injection frameworks such as Spring and Blueprint.
+ */
+ public void unregister() {
+ unregisterMBean();
+ }
+
/**
* Unregisters this bean with the platform MBean server.
*
unregisterMBean(mbeanName);
unregister = true;
} catch(Exception e) {
-
- LOG.error("Failed when unregistering MBean {}", e);
+ LOG.debug("Failed when unregistering MBean {}", e);
}
return unregister;