+ LOG.debug("Reading factory {} {}", moduleName, factory);
+
+ Map.Entry<ModuleFactory, BundleContext> conflicting = result.get(moduleName);
+ if (conflicting != null) {
+ String error = String.format(
+ "Module name is not unique. Found two conflicting factories with same name '%s': '%s' '%s'",
+ moduleName, conflicting.getKey(), factory);
+ LOG.error(error);
+ throw new IllegalArgumentException(error);
+ }
+
+ result.put(moduleName, new AbstractMap.SimpleImmutableEntry<>(factory,
+ serviceReference.getBundle().getBundleContext()));