Do not use blueprint-maven-plugin in of-switch-config-pusher 76/100076/6
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 11 Mar 2022 13:59:36 +0000 (14:59 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 14 Mar 2022 08:07:23 +0000 (09:07 +0100)
Inline the generated container and dist dependencies on annotations
and the plugin.

Change-Id: I574c2df5e46fa28e85f3d79b69d5d46f9e92ab29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
applications/of-switch-config-pusher/pom.xml
applications/of-switch-config-pusher/src/main/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusher.java
applications/of-switch-config-pusher/src/main/resources/OSGI-INF/blueprint/autowire.xml [new file with mode: 0644]

index 69050ba06d1c6fd1248d553de65ce5e33aed0318..4e2ca70e3fe1e4fcec5ebb09f9ec95dfd4fc2b0a 100644 (file)
             <artifactId>javax.annotation-api</artifactId>
             <optional>true</optional>
         </dependency>
-        <dependency>
-            <groupId>org.apache.aries.blueprint</groupId>
-            <artifactId>blueprint-maven-plugin-annotation</artifactId>
-            <optional>true</optional>
-        </dependency>
     </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.aries.blueprint</groupId>
-                <artifactId>blueprint-maven-plugin</artifactId>
-                <configuration>
-                    <scanPaths>
-                        <scanPath>org.opendaylight.openflowplugin.openflow.ofswitch.config</scanPath>
-                    </scanPaths>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>
index fec549741ea1cd320c8c82deed2fa856fd062e52..4f891948446e4608835765ef17d67db1d6001085 100644 (file)
@@ -14,7 +14,6 @@ import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
-import org.apache.aries.blueprint.annotation.service.Reference;
 import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
@@ -48,8 +47,8 @@ public class DefaultConfigPusher implements AutoCloseable, ClusteredDataTreeChan
     private ListenerRegistration<?> listenerRegistration;
 
     @Inject
-    public DefaultConfigPusher(final NodeConfigService nodeConfigService, @Reference final DataBroker dataBroker,
-            @Reference final DeviceOwnershipService deviceOwnershipService) {
+    public DefaultConfigPusher(final NodeConfigService nodeConfigService, final DataBroker dataBroker,
+            final DeviceOwnershipService deviceOwnershipService) {
         this.nodeConfigService = nodeConfigService;
         this.dataBroker = dataBroker;
         this.deviceOwnershipService = requireNonNull(deviceOwnershipService, "DeviceOwnershipService can not be null");
diff --git a/applications/of-switch-config-pusher/src/main/resources/OSGI-INF/blueprint/autowire.xml b/applications/of-switch-config-pusher/src/main/resources/OSGI-INF/blueprint/autowire.xml
new file mode 100644 (file)
index 0000000..3fbc553
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+    <bean id="defaultConfigPusher" class="org.opendaylight.openflowplugin.openflow.ofswitch.config.DefaultConfigPusher" init-method="start" destroy-method="close">
+        <argument ref="nodeConfigService"/>
+        <argument ref="dataBroker"/>
+        <argument ref="deviceOwnershipService"/>
+    </bean>
+    <reference id="dataBroker" interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
+    <reference id="deviceOwnershipService" interface="org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService"/>
+</blueprint>