Do not use blueprint-maven-plugin in device-ownership-service 72/100072/5
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 11 Mar 2022 13:50:20 +0000 (14:50 +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: I67d67aac7327bea03892f1da996af74d2e5a7b7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
applications/device-ownership-service/pom.xml
applications/device-ownership-service/src/main/java/org/opendaylight/openflowplugin/applications/deviceownershipservice/impl/DeviceOwnershipServiceImpl.java
applications/device-ownership-service/src/main/resources/OSGI-INF/blueprint/autowire.xml [new file with mode: 0644]

index 0534c26d85af9d89369b56043241da55d0226da4..efcee31376793c0deba165b1aa634844e0b376ca 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>
-            </plugin>
-        </plugins>
-    </build>
-
 </project>
index fcde56208006085f71ce4b5fa2aa89fd45b502a8..6ac688df46af723f96ea3f35262305a76e7029f5 100644 (file)
@@ -15,8 +15,6 @@ import java.util.regex.Pattern;
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.inject.Singleton;
-import org.apache.aries.blueprint.annotation.service.Reference;
-import org.apache.aries.blueprint.annotation.service.Service;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListener;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
@@ -27,7 +25,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
-@Service(classes = DeviceOwnershipService.class)
 public class DeviceOwnershipServiceImpl implements DeviceOwnershipService, EntityOwnershipListener {
     private static final Logger LOG = LoggerFactory.getLogger(DeviceOwnershipServiceImpl.class);
     private static final String SERVICE_ENTITY_TYPE = "org.opendaylight.mdsal.ServiceEntityType";
@@ -36,7 +33,7 @@ public class DeviceOwnershipServiceImpl implements DeviceOwnershipService, Entit
     private final EntityOwnershipService eos;
     private final ConcurrentMap<String, EntityOwnershipState> ownershipStateCache = new ConcurrentHashMap<>();
 
-    public DeviceOwnershipServiceImpl(@Reference final EntityOwnershipService entityOwnershipService) {
+    public DeviceOwnershipServiceImpl(final EntityOwnershipService entityOwnershipService) {
         this.eos = entityOwnershipService;
     }
 
diff --git a/applications/device-ownership-service/src/main/resources/OSGI-INF/blueprint/autowire.xml b/applications/device-ownership-service/src/main/resources/OSGI-INF/blueprint/autowire.xml
new file mode 100644 (file)
index 0000000..b0d7acd
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+    <bean id="deviceOwnershipServiceImpl" class="org.opendaylight.openflowplugin.applications.deviceownershipservice.impl.DeviceOwnershipServiceImpl" init-method="start" destroy-method="close">
+        <argument ref="entityOwnershipService"/>
+    </bean>
+    <reference id="entityOwnershipService" interface="org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService"/>
+    <service ref="deviceOwnershipServiceImpl" interface="org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService"/>
+</blueprint>