Do not use blueprint-maven-plugin in openflowplugin-impl 68/100068/5
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 11 Mar 2022 13:36:53 +0000 (14:36 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 11 Mar 2022 14:25:00 +0000 (15:25 +0100)
Inline the generated container and dist dependencies on annotations
and the plugin.

Change-Id: Ib8267a746689928980949d04dd5dcb690015c4b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
openflowplugin-impl/pom.xml
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/mastership/MastershipChangeServiceManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/cache/FlowGroupCacheManagerImpl.java
openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/autowire.xml [new file with mode: 0644]

index 2aaed707609f5195a8f7fefa8d6b6a09bb930466..4e213fc9c924099340eae7f59720a8368e0ead60 100644 (file)
             <groupId>org.opendaylight.infrautils</groupId>
             <artifactId>diagstatus-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.aries.blueprint</groupId>
-            <artifactId>blueprint-maven-plugin-annotation</artifactId>
-            <optional>true</optional>
-        </dependency>
         <dependency>
             <groupId>${project.groupId}.openflowjava</groupId>
             <artifactId>openflow-protocol-spi</artifactId>
 
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.apache.aries.blueprint</groupId>
-                <artifactId>blueprint-maven-plugin</artifactId>
-                <configuration>
-                    <scanPaths>
-                        <scanPath>org.opendaylight.openflowplugin.impl</scanPath>
-                    </scanPaths>
-                </configuration>
-            </plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
index 88216bd568677aadba734a1b92bcdad6e93eb5bc..5eea2de76ba8760d225da36c3aa5051fa9209c6f 100644 (file)
@@ -37,8 +37,6 @@ import javax.management.MBeanServer;
 import javax.management.MalformedObjectNameException;
 import javax.management.NotCompliantMBeanException;
 import javax.management.ObjectName;
-import org.apache.aries.blueprint.annotation.service.Reference;
-import org.apache.aries.blueprint.annotation.service.Service;
 import org.opendaylight.infrautils.diagstatus.ServiceState;
 import org.opendaylight.infrautils.ready.SystemReadyListener;
 import org.opendaylight.infrautils.ready.SystemReadyMonitor;
@@ -90,8 +88,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
-@Service(classes = { OpenFlowPluginProvider.class, OpenFlowPluginExtensionRegistratorProvider.class,
-                     FlowGroupInfoHistories.class })
 public class OpenFlowPluginProviderImpl implements
         OpenFlowPluginProvider,
         OpenFlowPluginExtensionRegistratorProvider,
@@ -143,13 +139,13 @@ public class OpenFlowPluginProviderImpl implements
     public OpenFlowPluginProviderImpl(final ConfigurationService configurationService,
                                final SwitchConnectionProviderList switchConnectionProviders,
                                final PingPongDataBroker pingPongDataBroker,
-                               final @Reference RpcProviderService rpcProviderRegistry,
-                               final @Reference NotificationPublishService notificationPublishService,
-                               final @Reference ClusterSingletonServiceProvider singletonServiceProvider,
-                               final @Reference EntityOwnershipService entityOwnershipService,
+                               final RpcProviderService rpcProviderRegistry,
+                               final NotificationPublishService notificationPublishService,
+                               final ClusterSingletonServiceProvider singletonServiceProvider,
+                               final EntityOwnershipService entityOwnershipService,
                                final MastershipChangeServiceManager mastershipChangeServiceManager,
-                               final @Reference OpenflowDiagStatusProvider openflowDiagStatusProvider,
-                               final @Reference SystemReadyMonitor systemReadyMonitor) {
+                               final OpenflowDiagStatusProvider openflowDiagStatusProvider,
+                               final SystemReadyMonitor systemReadyMonitor) {
         this.switchConnectionProviders = switchConnectionProviders;
         this.dataBroker = pingPongDataBroker;
         this.rpcProviderRegistry = rpcProviderRegistry;
index 20f61a5809dea33bd7062ab6feacd1e54b1e394a..f9443e2d2c8285076344d48963c3f254be1161a3 100644 (file)
@@ -15,7 +15,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 import javax.inject.Singleton;
-import org.apache.aries.blueprint.annotation.service.Service;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.lifecycle.MasterChecker;
@@ -30,7 +29,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
-@Service(classes = MastershipChangeServiceManager.class)
 public final class MastershipChangeServiceManagerImpl implements MastershipChangeServiceManager {
 
     private static final Logger LOG = LoggerFactory.getLogger(MastershipChangeServiceManagerImpl.class);
index ee1ec60a500634b627078036a7e0fd00cce1adc1..38f4df09cfb0c20f088e057a3bb0d9645733e7ad 100644 (file)
@@ -10,12 +10,10 @@ package org.opendaylight.openflowplugin.impl.services.cache;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import javax.inject.Singleton;
-import org.apache.aries.blueprint.annotation.service.Service;
 import org.opendaylight.openflowplugin.api.openflow.FlowGroupCacheManager;
 import org.opendaylight.openflowplugin.api.openflow.ReconciliationState;
 
 @Singleton
-@Service(classes = FlowGroupCacheManager.class)
 public class FlowGroupCacheManagerImpl implements FlowGroupCacheManager {
     private final Map<String, ReconciliationState> reconciliationStates = new ConcurrentHashMap<>();
 
diff --git a/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/autowire.xml b/openflowplugin-impl/src/main/resources/OSGI-INF/blueprint/autowire.xml
new file mode 100644 (file)
index 0000000..ad51e55
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+    <bean id="flowGroupCacheManagerImpl" class="org.opendaylight.openflowplugin.impl.services.cache.FlowGroupCacheManagerImpl"/>
+    <bean id="mastershipChangeServiceManagerImpl" class="org.opendaylight.openflowplugin.impl.mastership.MastershipChangeServiceManagerImpl"/>
+    <bean id="openFlowPluginProviderImpl" class="org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl" init-method="initialize" destroy-method="close">
+        <argument ref="configurationService"/>
+        <argument ref="switchConnectionProviderList"/>
+        <argument ref="pingPongDataBroker"/>
+        <argument ref="rpcProviderService"/>
+        <argument ref="notificationPublishService"/>
+        <argument ref="clusterSingletonServiceProvider"/>
+        <argument ref="entityOwnershipService"/>
+        <argument ref="mastershipChangeServiceManagerImpl"/>
+        <argument ref="openflowDiagStatusProvider"/>
+        <argument ref="systemReadyMonitor"/>
+    </bean>
+    <reference id="systemReadyMonitor" interface="org.opendaylight.infrautils.ready.SystemReadyMonitor"/>
+    <reference id="notificationPublishService" interface="org.opendaylight.mdsal.binding.api.NotificationPublishService"/>
+    <reference id="rpcProviderService" interface="org.opendaylight.mdsal.binding.api.RpcProviderService"/>
+    <reference id="entityOwnershipService" interface="org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService"/>
+    <reference id="clusterSingletonServiceProvider" interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/>
+    <reference id="openflowDiagStatusProvider" interface="org.opendaylight.openflowjava.protocol.api.connection.OpenflowDiagStatusProvider"/>
+    <service ref="flowGroupCacheManagerImpl" interface="org.opendaylight.openflowplugin.api.openflow.FlowGroupCacheManager"/>
+    <service ref="mastershipChangeServiceManagerImpl" interface="org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager"/>
+    <service ref="openFlowPluginProviderImpl">
+        <interfaces>
+            <value>org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider</value>
+            <value>org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider</value>
+            <value>org.opendaylight.openflowplugin.api.openflow.FlowGroupInfoHistories</value>
+        </interfaces>
+    </service>
+</blueprint>