Rework binding component instantiation 28/88028/18
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 24 Feb 2020 11:40:56 +0000 (12:40 +0100)
committerRobert Varga <nite@hq.sk>
Fri, 28 Feb 2020 14:58:28 +0000 (14:58 +0000)
commitaa5816d267a0ee82fef7e8d9bcdf467fcacd10c3
treead6ca25229699072b8aaa7795dd70e748556d2fe
parent49d03d3ce5f88c87a54e38f859fbbf5c316c3862
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>
35 files changed:
artifacts/pom.xml
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]
binding/pom.xml
docs/pom.xml
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/schema/ScanningSchemaServiceProvider.java
dom/mdsal-dom-schema-osgi/pom.xml [moved from dom/mdsal-dom-schema-service-osgi/pom.xml with 82% similarity]
dom/mdsal-dom-schema-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/osgi/OSGiModuleInfoSnapshot.java [new file with mode: 0644]
dom/mdsal-dom-schema-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/osgi/impl/OSGiDOMSchemaService.java [new file with mode: 0644]
dom/mdsal-dom-schema-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/osgi/impl/OSGiEffectiveModelImpl.java [new file with mode: 0644]
dom/mdsal-dom-schema-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/osgi/impl/OSGiModelRuntime.java [new file with mode: 0644]
dom/mdsal-dom-schema-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/osgi/impl/SchemaSchemaContextListenerImpl.java [new file with mode: 0644]
dom/mdsal-dom-schema-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/osgi/impl/YangModuleInfoRegistry.java [new file with mode: 0644]
dom/mdsal-dom-schema-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/osgi/impl/YangModuleInfoScanner.java [new file with mode: 0644]
dom/mdsal-dom-schema-osgi/src/test/java/org/opendaylight/mdsal/dom/schema/osgi/impl/OSGiModelRuntimeTest.java [new file with mode: 0644]
dom/mdsal-dom-schema-osgi/src/test/java/org/opendaylight/mdsal/dom/schema/osgi/impl/TestModel.java [moved from dom/mdsal-dom-schema-service-osgi/src/test/java/org/opendaylight/mdsal/dom/schema/service/osgi/util/TestModel.java with 98% similarity]
dom/mdsal-dom-schema-osgi/src/test/resources/odl-datastore-test.yang [moved from dom/mdsal-dom-schema-service-osgi/src/test/resources/odl-datastore-test.yang with 100% similarity]
dom/mdsal-dom-schema-service-osgi/src/main/java/org/opendaylight/mdsal/dom/schema/service/osgi/OsgiBundleScanningSchemaService.java [deleted file]
dom/mdsal-dom-schema-service-osgi/src/main/resources/org/opendaylight/blueprint/dom-osgi-schema-service.xml [deleted file]
dom/mdsal-dom-schema-service-osgi/src/test/java/org/opendaylight/mdsal/dom/schema/service/osgi/OsgiBundleScanningSchemaServiceTest.java [deleted file]
dom/pom.xml
features/odl-mdsal-binding-runtime-api/pom.xml [new file with mode: 0644]
features/odl-mdsal-binding-runtime/pom.xml
features/odl-mdsal-dom-broker/pom.xml
features/pom.xml