*/
package org.opendaylight.controller.config.manager.impl.jmx;
+import com.google.common.base.Preconditions;
import java.util.Collections;
import javax.management.InstanceAlreadyExistsException;
import javax.management.ObjectName;
private final ModuleIdentifier moduleIdentifier;
private final ObjectName defaultRuntimeON;
- public RootRuntimeBeanRegistratorImpl(
- InternalJMXRegistrator internalJMXRegistrator,
- ModuleIdentifier moduleIdentifier) {
- this.internalJMXRegistrator = internalJMXRegistrator;
+ RootRuntimeBeanRegistratorImpl(final InternalJMXRegistrator internalJMXRegistrator,
+ final ModuleIdentifier moduleIdentifier) {
+ this.internalJMXRegistrator = Preconditions.checkNotNull(internalJMXRegistrator);
this.moduleIdentifier = moduleIdentifier;
defaultRuntimeON = ObjectNameUtil.createRuntimeBeanName(
moduleIdentifier.getFactoryName(),
}
@Override
- public HierarchicalRuntimeBeanRegistrationImpl registerRoot(
- RuntimeBean mxBean) {
+ public HierarchicalRuntimeBeanRegistrationImpl registerRoot(final RuntimeBean mxBean) {
try {
internalJMXRegistrator.registerMBean(mxBean, defaultRuntimeON);
} catch (InstanceAlreadyExistsException e) {
internalJMXRegistrator.close();
}
- static IllegalStateException sanitize(InstanceAlreadyExistsException e,
- ModuleIdentifier moduleIdentifier, ObjectName on) {
+ static IllegalStateException sanitize(final InstanceAlreadyExistsException e,
+ final ModuleIdentifier moduleIdentifier, final ObjectName on) {
throw new IllegalStateException("Could not register runtime bean in "
+ moduleIdentifier + " under name " + on, e);