X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2FConfigTransactionControllerImpl.java;h=3f569ae324ebebe51cf0550aa74b21bbcc8d58b8;hb=7e9c91c57da1cac389e8234b738219a5fe671c36;hp=e732db9f55fd89c040a619f476212ead2e0cfd5a;hpb=4f623c74a703a31e787387b536981dcb344ca4f9;p=controller.git diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java index e732db9f55..3f569ae324 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigTransactionControllerImpl.java @@ -138,8 +138,10 @@ class ConfigTransactionControllerImpl implements for (ModuleFactory moduleFactory : toBeAdded) { Set defaultModules = moduleFactory.getDefaultModules(dependencyResolverManager, bundleContext); for (Module module : defaultModules) { + // ensure default module to be registered to jmx even if its module factory does not use dependencyResolverFactory + DependencyResolver dependencyResolver = dependencyResolverManager.getOrCreate(module.getIdentifier()); try { - putConfigBeanToJMXAndInternalMaps(module.getIdentifier(), module, moduleFactory, null); + putConfigBeanToJMXAndInternalMaps(module.getIdentifier(), module, moduleFactory, null, dependencyResolver); } catch (InstanceAlreadyExistsException e) { throw new IllegalStateException(e); } @@ -179,7 +181,7 @@ class ConfigTransactionControllerImpl implements "Error while copying old configuration from %s to %s", oldConfigBeanInfo, moduleFactory), e); } - putConfigBeanToJMXAndInternalMaps(moduleIdentifier, module, moduleFactory, oldConfigBeanInfo); + putConfigBeanToJMXAndInternalMaps(moduleIdentifier, module, moduleFactory, oldConfigBeanInfo, dependencyResolver); } @Override @@ -196,19 +198,24 @@ class ConfigTransactionControllerImpl implements DependencyResolver dependencyResolver = dependencyResolverManager.getOrCreate(moduleIdentifier); Module module = moduleFactory.createModule(instanceName, dependencyResolver, bundleContext); return putConfigBeanToJMXAndInternalMaps(moduleIdentifier, module, - moduleFactory, null); + moduleFactory, null, dependencyResolver); } private synchronized ObjectName putConfigBeanToJMXAndInternalMaps( ModuleIdentifier moduleIdentifier, Module module, ModuleFactory moduleFactory, - @Nullable ModuleInternalInfo maybeOldConfigBeanInfo) + @Nullable ModuleInternalInfo maybeOldConfigBeanInfo, DependencyResolver dependencyResolver) throws InstanceAlreadyExistsException { + logger.debug("Adding module {} to transaction {}", moduleIdentifier, this); if (moduleIdentifier.equals(module.getIdentifier())==false) { throw new IllegalStateException("Incorrect name reported by module. Expected " + moduleIdentifier + ", got " + module.getIdentifier()); } + if (dependencyResolver.getIdentifier().equals(moduleIdentifier) == false ) { + throw new IllegalStateException("Incorrect name reported by dependency resolver. Expected " + + moduleIdentifier + ", got " + dependencyResolver.getIdentifier()); + } DynamicMBean writableDynamicWrapper = new DynamicWritableWrapper( module, moduleIdentifier, transactionIdentifier, readOnlyAtomicBoolean, transactionsMBeanServer, @@ -345,7 +352,7 @@ class ConfigTransactionControllerImpl implements ModuleIdentifier name = entry.getKey(); try { logger.debug("About to commit {} in transaction {}", - transactionIdentifier, name); + name, transactionIdentifier); module.getInstance(); } catch (Exception e) { logger.error("Commit failed on {} in transaction {}", name,