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=4589b1c99f6a35e980af42885bcdbabcfd3503a5;hp=4c3726d32e9cda4a46566be314832c22ec5cf889;hpb=3b3c918f1206764230f61fcd3ea44bbfe382748a;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 4c3726d32e..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 @@ -19,7 +19,7 @@ import java.util.Collections; import java.util.Enumeration; import java.util.List; import java.util.concurrent.atomic.AtomicReference; -import javax.annotation.concurrent.GuardedBy; +import org.checkerframework.checker.lock.qual.GuardedBy; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.dom.broker.schema.ScanningSchemaServiceProvider; import org.opendaylight.yangtools.concepts.Registration; @@ -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");