Convert mdsal-dom-broker to a JPMS module 43/105743/11
authorSamuel Schneider <samuel.schneider@pantheon.tech>
Fri, 28 Apr 2023 15:59:06 +0000 (17:59 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 16 Jun 2023 09:07:50 +0000 (11:07 +0200)
Convert to a JPMS to prevent reflective access.
For compatibility, we still need to export the implementation details.

JIRA: MDSAL-749
Change-Id: I85baf0f41c415d02fe2d7b02a70e2b57b502ad9f
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
dom/mdsal-dom-broker/pom.xml
dom/mdsal-dom-broker/src/main/java/module-info.java [new file with mode: 0644]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMRpcRouter.java

index 551e75e2a6b19746c3ce719ad58775e6616c1713..52429f22c0a346580180f720f98bdc84cf3bf4a4 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-data-tree-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-data-impl</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-model-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-parser-api</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-repo-api</artifactId>
             <artifactId>yang-ext</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-parser-api</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <scm>
diff --git a/dom/mdsal-dom-broker/src/main/java/module-info.java b/dom/mdsal-dom-broker/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..df0dbb2
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl;
+
+module org.opendaylight.mdsal.dom.broker {
+    exports org.opendaylight.mdsal.dom.broker;
+
+    provides DOMMountPointService with DOMMountPointServiceImpl;
+
+    requires transitive org.opendaylight.mdsal.common.api;
+    requires transitive org.opendaylight.mdsal.dom.api;
+    requires transitive org.opendaylight.mdsal.dom.spi;
+    requires com.google.common;
+    requires org.slf4j;
+
+    // Annotations
+    requires static transitive java.annotation;
+    requires static transitive javax.inject;
+    requires static org.kohsuke.metainf_services;
+    requires static org.osgi.service.component.annotations;
+    requires static org.osgi.service.metatype.annotations;
+}
index 647d2cd06a32f784eb860f36703cbe2ffe83b538..a0d1f1418d7ed74496c5de247cd1dafbd834462c 100644 (file)
@@ -80,13 +80,11 @@ import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
 import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
 @Component(immediate = true, service = DOMRpcRouterServices.class)
-@RequireServiceComponentRuntime
 public final class DOMRpcRouter extends AbstractRegistration
         implements DOMRpcRouterServices, EffectiveModelContextListener {
     private static final Logger LOG = LoggerFactory.getLogger(DOMRpcRouter.class);