X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=dom%2Fmdsal-dom-schema-service-osgi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fdom%2Fschema%2Fservice%2Fosgi%2FOsgiBundleScanningSchemaService.java;h=727d790ab2d7a883a809ed3ee5109ca47cec8296;hb=a246443e10cc43adace7bc36fdf8014d76010389;hp=d1917c0bef4543d5be8aeec42b0cb3ae26b06558;hpb=cd592a5f5f219b4a646798ef068244873ab03ad6;p=mdsal.git diff --git a/dom/mdsal-dom-schema-service-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/service/osgi/OsgiBundleScanningSchemaService.java b/dom/mdsal-dom-schema-service-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/service/osgi/OsgiBundleScanningSchemaService.java index d1917c0bef..727d790ab2 100644 --- a/dom/mdsal-dom-schema-service-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/service/osgi/OsgiBundleScanningSchemaService.java +++ b/dom/mdsal-dom-schema-service-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/service/osgi/OsgiBundleScanningSchemaService.java @@ -27,6 +27,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContextListener; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleEvent; +import org.osgi.framework.Constants; import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.BundleTracker; import org.osgi.util.tracker.BundleTrackerCustomizer; @@ -40,7 +41,6 @@ public final class OsgiBundleScanningSchemaService extends ScanningSchemaService private static final Logger LOG = LoggerFactory.getLogger(OsgiBundleScanningSchemaService.class); private static final AtomicReference GLOBAL_INSTANCE = new AtomicReference<>(); - private static final long FRAMEWORK_BUNDLE_ID = 0; private final BundleScanner scanner = new BundleScanner(); private final BundleContext context; @@ -125,7 +125,7 @@ public final class OsgiBundleScanningSchemaService extends ScanningSchemaService @Override public Iterable addingBundle(final Bundle bundle, final BundleEvent event) { - if (bundle.getBundleId() == FRAMEWORK_BUNDLE_ID) { + if (bundle.getBundleId() == Constants.SYSTEM_BUNDLE_ID) { return Collections.emptyList(); } @@ -158,7 +158,7 @@ public final class OsgiBundleScanningSchemaService extends ScanningSchemaService @Override public void modifiedBundle(final Bundle bundle, final BundleEvent event, final Iterable object) { - if (bundle.getBundleId() == FRAMEWORK_BUNDLE_ID) { + if (bundle.getBundleId() == Constants.SYSTEM_BUNDLE_ID) { LOG.debug("Framework bundle {} got event {}", bundle, event.getType()); if ((event.getType() & BundleEvent.STOPPING) != 0) { LOG.info("OSGi framework is being stopped, halting bundle scanning");