Convert mdsal-binding-util to a JPMS module 82/93682/2
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 8 Nov 2020 11:56:07 +0000 (12:56 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 8 Nov 2020 16:35:22 +0000 (17:35 +0100)
This is a widely used utility artifact. Convert it to JPMS.

Change-Id: Ic636b6f513d79ec495abb7d1d83a899712126f8e
JIRA: MDSAL-634
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-util/pom.xml
binding/mdsal-binding-util/src/main/java/module-info.java [new file with mode: 0644]
binding/mdsal-binding-util/src/main/java/org/opendaylight/mdsal/binding/util/RetryingManagedNewTransactionRunner.java

index d6057e102bd9889e846a1715d481263df29bc80f..d043bdac7218707dc91407ceb80c9718b4f927a2 100644 (file)
@@ -29,7 +29,7 @@
             <artifactId>mdsal-binding-spi</artifactId>
         </dependency>
         <dependency>
-            <groupId>javax.inject</groupId>
+            <groupId>com.guicedee.services</groupId>
             <artifactId>javax.inject</artifactId>
             <optional>true</optional>
         </dependency>
         </dependency>
     </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <configuration>
-                    <instructions>
-                        <Automatic-Module-Name>org.opendaylight.mdsal.binding.util</Automatic-Module-Name>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
     <scm>
         <connection>scm:git:http://git.opendaylight.org/gerrit/controller.git</connection>
         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
diff --git a/binding/mdsal-binding-util/src/main/java/module-info.java b/binding/mdsal-binding-util/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..22efd47
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2020 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
+ */
+module org.opendaylight.mdsal.binding.util {
+    exports org.opendaylight.mdsal.binding.util;
+
+    requires transitive org.opendaylight.mdsal.binding.api;
+    requires transitive org.opendaylight.mdsal.common.api;
+    requires org.opendaylight.mdsal.binding.spi;
+    requires org.opendaylight.yangtools.util;
+    requires org.slf4j;
+
+    // Annotations
+    requires static transitive org.eclipse.jdt.annotation;
+    requires static transitive javax.inject;
+    requires static com.github.spotbugs.annotations;
+}
index 30dc642fb7676b12129aeac2b70c27c0d7a81e51..0e65e3b52fff1e046182776ab0a3ec8ab86aec0d 100644 (file)
@@ -39,9 +39,9 @@ import org.opendaylight.mdsal.common.api.OptimisticLockFailedException;
  * @author Michael Vorburger.ch &amp; Stephen Kitt
  */
 @Beta
-// Do *NOT* mark this as @Singleton, because users choose Impl; and as long as this in API, because of https://wiki.opendaylight.org/view/BestPractices/DI_Guidelines#Nota_Bene
+// Do *NOT* mark this as @Singleton, because users choose Impl; and as long as this in API, because of
+// https://wiki-archive.opendaylight.org/view/BestPractices/DI_Guidelines#Nota_Bene
 public class RetryingManagedNewTransactionRunner extends RetryingManagedNewTransactionRunnerImpl {
-
     /**
      * Constructor.
      * Please see the class level documentation above for more details about the threading model used.
@@ -51,7 +51,7 @@ public class RetryingManagedNewTransactionRunner extends RetryingManagedNewTrans
      * @throws NullPointerException if {@code dataBroker} is {@code null}.
      */
     @Inject
-    public RetryingManagedNewTransactionRunner(DataBroker dataBroker) {
+    public RetryingManagedNewTransactionRunner(final DataBroker dataBroker) {
         super(new ManagedNewTransactionRunnerImpl(dataBroker));
     }
 
@@ -62,7 +62,7 @@ public class RetryingManagedNewTransactionRunner extends RetryingManagedNewTrans
      * @param dataBroker the {@link DataBroker} from which transactions are obtained
      * @param maxRetries the maximum number of retry attempts
      */
-    public RetryingManagedNewTransactionRunner(DataBroker dataBroker, int maxRetries) {
+    public RetryingManagedNewTransactionRunner(final DataBroker dataBroker, final int maxRetries) {
         super(new ManagedNewTransactionRunnerImpl(dataBroker), maxRetries);
     }
 
@@ -74,7 +74,8 @@ public class RetryingManagedNewTransactionRunner extends RetryingManagedNewTrans
      * @param executor the {@link Executor} to asynchronously run any retry attempts in
      * @param maxRetries the maximum number of retry attempts
      */
-    public RetryingManagedNewTransactionRunner(DataBroker dataBroker, Executor executor, int maxRetries) {
+    public RetryingManagedNewTransactionRunner(final DataBroker dataBroker, final Executor executor,
+            final int maxRetries) {
         super(new ManagedNewTransactionRunnerImpl(dataBroker), executor, maxRetries);
     }
 }