From da0e1ea58bd43330423c5f9e9309687ede8a6a40 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sun, 8 Nov 2020 12:56:07 +0100 Subject: [PATCH] Convert mdsal-binding-util to a JPMS module This is a widely used utility artifact. Convert it to JPMS. Change-Id: Ic636b6f513d79ec495abb7d1d83a899712126f8e JIRA: MDSAL-634 Signed-off-by: Robert Varga --- binding/mdsal-binding-util/pom.xml | 16 +------------- .../src/main/java/module-info.java | 21 +++++++++++++++++++ .../RetryingManagedNewTransactionRunner.java | 11 +++++----- 3 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 binding/mdsal-binding-util/src/main/java/module-info.java diff --git a/binding/mdsal-binding-util/pom.xml b/binding/mdsal-binding-util/pom.xml index d6057e102b..d043bdac72 100644 --- a/binding/mdsal-binding-util/pom.xml +++ b/binding/mdsal-binding-util/pom.xml @@ -29,7 +29,7 @@ mdsal-binding-spi - javax.inject + com.guicedee.services javax.inject true @@ -44,20 +44,6 @@ - - - - org.apache.felix - maven-bundle-plugin - - - org.opendaylight.mdsal.binding.util - - - - - - scm:git:http://git.opendaylight.org/gerrit/controller.git scm:git:ssh://git.opendaylight.org:29418/controller.git 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 index 0000000000..22efd47e48 --- /dev/null +++ b/binding/mdsal-binding-util/src/main/java/module-info.java @@ -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; +} diff --git a/binding/mdsal-binding-util/src/main/java/org/opendaylight/mdsal/binding/util/RetryingManagedNewTransactionRunner.java b/binding/mdsal-binding-util/src/main/java/org/opendaylight/mdsal/binding/util/RetryingManagedNewTransactionRunner.java index 30dc642fb7..0e65e3b52f 100644 --- a/binding/mdsal-binding-util/src/main/java/org/opendaylight/mdsal/binding/util/RetryingManagedNewTransactionRunner.java +++ b/binding/mdsal-binding-util/src/main/java/org/opendaylight/mdsal/binding/util/RetryingManagedNewTransactionRunner.java @@ -39,9 +39,9 @@ import org.opendaylight.mdsal.common.api.OptimisticLockFailedException; * @author Michael Vorburger.ch & 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); } } -- 2.36.6