Ditch Automatic-Module-Name and instead provide a proper module.
JIRA: MDSAL-619
Change-Id: I940072ba15c14a73b918f41c11c80a85e31aa872
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
<packaging>bundle</packaging>
<dependencies>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-model-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-runtime-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-runtime-spi</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Automatic-Module-Name>org.opendaylight.mdsal.binding.runtime.osgi</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
--- /dev/null
+/*
+ * 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
+ */
+module org.opendaylight.mdsal.binding.runtime.osgi {
+ exports org.opendaylight.mdsal.binding.runtime.osgi;
+
+ requires transitive org.opendaylight.mdsal.dom.schema.osgi;
+
+ requires com.google.common;
+ requires org.opendaylight.mdsal.binding.runtime.api;
+ requires org.opendaylight.mdsal.binding.runtime.spi;
+ requires org.osgi.framework;
+ requires org.osgi.service.component;
+ requires org.slf4j;
+
+ // Annotations
+ requires static com.github.spotbugs.annotations;
+ requires static org.checkerframework.checker.qual;
+ requires static org.eclipse.jdt.annotation;
+ requires static org.osgi.service.component.annotations;
+}
import static com.google.common.base.Verify.verifyNotNull;
-import com.google.common.annotations.Beta;
import com.google.common.primitives.UnsignedLong;
import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
import org.opendaylight.mdsal.binding.runtime.osgi.OSGiBindingRuntimeContext;
/**
* A global {@link BindingRuntimeContext}. It is injected with latest {@link OSGiBindingRuntimeContext} generation.
*/
-@Beta
@Component(service = BindingRuntimeContext.class, immediate = true)
public final class GlobalBindingRuntimeContext extends ForwardingBindingRuntimeContext {
private static final Logger LOG = LoggerFactory.getLogger(GlobalBindingRuntimeContext.class);
- @Reference
- OSGiBindingRuntimeContext osgi = null;
-
+ private final UnsignedLong generation;
private BindingRuntimeContext delegate;
- private UnsignedLong generation;
-
- @Override
- protected BindingRuntimeContext delegate() {
- return verifyNotNull(delegate);
- }
@Activate
- void activate() {
+ public GlobalBindingRuntimeContext(@Reference final OSGiBindingRuntimeContext osgi) {
generation = osgi.getGeneration();
delegate = osgi.getService();
LOG.info("Global BindingRuntimeContext generation {} activated", generation);
}
+ @Override
+ protected BindingRuntimeContext delegate() {
+ return verifyNotNull(delegate);
+ }
+
@Deactivate
void deactivate() {
delegate = null;