-import org.opendaylight.yangtools.concepts.Registration;
-import org.opendaylight.yangtools.sal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.sal.binding.generator.api.ModuleInfoRegistry;
import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
import org.osgi.framework.Bundle;
import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
import org.osgi.framework.Bundle;
- public GeneratedClassLoadingStrategy getModuleInfoLoadingStrategy() {
- return moduleInfoLoadingStrategy;
+ private final ModuleInfoRegistry moduleInfoRegistry;
+
+ public ModuleInfoBundleTracker(ModuleInfoRegistry moduleInfoRegistry) {
+ this.moduleInfoRegistry = moduleInfoRegistry;
try (InputStream inputStream = resource.openStream()) {
List<String> lines = IOUtils.readLines(inputStream);
for (String moduleInfoName : lines) {
try (InputStream inputStream = resource.openStream()) {
List<String> lines = IOUtils.readLines(inputStream);
for (String moduleInfoName : lines) {
} catch (Exception e) {
logger.error("Error while reading {}", resource, e);
throw new RuntimeException(e);
}
} catch (Exception e) {
logger.error("Error while reading {}", resource, e);
throw new RuntimeException(e);
}
- public void modifiedBundle(Bundle bundle, BundleEvent event, Collection<Registration<YangModuleInfo>> object) {
- // NOOP
+ public void modifiedBundle(Bundle bundle, BundleEvent event, Collection<ObjectRegistration<YangModuleInfo>> object) {
- public void removedBundle(Bundle bundle, BundleEvent event, Collection<Registration<YangModuleInfo>> regs) {
+ public void removedBundle(Bundle bundle, BundleEvent event, Collection<ObjectRegistration<YangModuleInfo>> regs) {
errorMessage = logMessage("Could not instantiate {} in bundle {}, reason {}", moduleInfoClass, bundle, e);
throw new IllegalStateException(errorMessage, e);
} catch (IllegalAccessException e) {
errorMessage = logMessage("Could not instantiate {} in bundle {}, reason {}", moduleInfoClass, bundle, e);
throw new IllegalStateException(errorMessage, e);
} catch (IllegalAccessException e) {
- errorMessage = logMessage("Illegal access during instatiation of class {} in bundle {}, reason {}",
+ errorMessage = logMessage("Illegal access during instantiation of class {} in bundle {}, reason {}",
moduleInfoClass, bundle, e);
throw new IllegalStateException(errorMessage, e);
}
moduleInfoClass, bundle, e);
throw new IllegalStateException(errorMessage, e);
}
- String errorMessage = logMessage("Could not find class {} in bunde {}, reason {}", moduleInfoClass, bundle, e);
+ String errorMessage = logMessage("Could not find class {} in bundle {}, reason {}", moduleInfoClass, bundle, e);