Rework binding component instantiation
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 24 Feb 2020 11:40:56 +0000 (12:40 +0100)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 19 Jun 2024 00:41:31 +0000 (10:41 +1000)
commit2b240b714f16d1c6f0601d36b26b35e0ebcb45af
tree269e096db1ea1bd9a15fc4ff543590b1a2d46776
parent6779ba82e9af753f458cde88c56536051bfa3f5c
Rework binding component instantiation

This reshuffles how DOM and Binding interoperate where schema is
concerned. Since Binding requires Classloader information available
at scanning time, we refactor mdsal-dom-schema-service-osgi to
actually perform Binding-aware scanning, so that this information
is available in ModuleInfoSnapshot.

These are published as OSGiModuleInfoSnapshot along with generation
number for easier reference by a new component, OSGiModelRuntime.

DOMSchemaService is realized on top of ServiceRegistry, where it
listens for OSGiModelRuntime and for SchemaContextListeners, driving
an OSGi whiteboard pattern.

This renders mdsal-binding-dom-codec-osgi completely superfluous,
as there is not enough magic going on to justify it.

mdsal-binding-runtime-osgi is also hooked onto OSGiModuleInfoSnapshot,
providing BindingRuntimeContexts as needed and retaining generation
inforation.

JIRA: MDSAL-392
Change-Id: I083caf3abbc3d7e2212d1df14e45d2745096b5f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 files changed:
binding/mdsal-binding-dom-codec-osgi/src/main/java/org/opendaylight/mdsal/binding/dom/codec/osgi/impl/BindingClassLoadingStrategy.java [deleted file]
binding/mdsal-binding-dom-codec-osgi/src/main/java/org/opendaylight/mdsal/binding/dom/codec/osgi/impl/ModuleInfoBundleTracker.java [deleted file]
binding/mdsal-binding-dom-codec-osgi/src/main/java/org/opendaylight/mdsal/binding/dom/codec/osgi/impl/OsgiModuleInfoRegistry.java [deleted file]
binding/mdsal-binding-runtime-api/src/main/java/org/opendaylight/binding/runtime/api/ModuleInfoSnapshot.java [new file with mode: 0644]
binding/mdsal-binding-runtime-osgi/pom.xml [moved from binding/mdsal-binding-dom-codec-osgi/pom.xml with 75% similarity]
binding/mdsal-binding-runtime-osgi/src/main/java/org/opendaylight/mdsal/binding/runtime/osgi/impl/BindingRuntimeContextImpl.java [new file with mode: 0644]
binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/binding/runtime/spi/AbstractModuleInfoTracker.java [new file with mode: 0644]
binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/binding/runtime/spi/BindingRuntimeHelpers.java
binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/binding/runtime/spi/DefaultModuleInfoSnapshot.java [new file with mode: 0644]
binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/binding/runtime/spi/ModuleInfoBackedContext.java
binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/binding/runtime/spi/ModuleInfoRegistry.java [deleted file]
binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/binding/runtime/spi/ModuleInfoSnapshotBuilder.java [new file with mode: 0644]