use of org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicWritableWrapper in project controller by opendaylight.
the class ConfigTransactionControllerImpl method putConfigBeanToJMXAndInternalMaps.
private synchronized ObjectName putConfigBeanToJMXAndInternalMaps(final ModuleIdentifier moduleIdentifier, final Module module, final ModuleFactory moduleFactory, @Nullable final ModuleInternalInfo maybeOldConfigBeanInfo, final DependencyResolver dependencyResolver, final boolean isDefaultBean, final BundleContext bundleContext) throws InstanceAlreadyExistsException {
LOG.debug("Adding module {} to transaction {}", moduleIdentifier, this);
if (!moduleIdentifier.equals(module.getIdentifier())) {
throw new IllegalStateException("Incorrect name reported by module. Expected " + moduleIdentifier + ", got " + module.getIdentifier());
}
if (!dependencyResolver.getIdentifier().equals(moduleIdentifier)) {
throw new IllegalStateException("Incorrect name reported by dependency resolver. Expected " + moduleIdentifier + ", got " + dependencyResolver.getIdentifier());
}
DynamicMBean writableDynamicWrapper = new DynamicWritableWrapper(module, moduleIdentifier, getTransactionIdentifier().getName(), readOnlyAtomicBoolean, transactionsMBeanServer, configMBeanServer);
ObjectName writableON = ObjectNameUtil.createTransactionModuleON(getTransactionIdentifier().getName(), moduleIdentifier);
// put wrapper to jmx
TransactionModuleJMXRegistration transactionModuleJMXRegistration = getTxModuleJMXRegistrator().registerMBean(writableDynamicWrapper, writableON);
dependencyResolverManager.put(moduleIdentifier, module, moduleFactory, maybeOldConfigBeanInfo, transactionModuleJMXRegistration, isDefaultBean, bundleContext);
return writableON;
}
Aggregations