Remove blueprint from rsvp-impl 19/93719/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 10 Nov 2020 14:48:23 +0000 (15:48 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 10 Nov 2020 14:52:42 +0000 (15:52 +0100)
rsvp-impl ends up being very simple in what it does, convert it
to OSGi DS.

JIRA: BGPCEP-924
Change-Id: I365e3daf26edc28ea842e59448144adbacbf4135
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
rsvp/impl/pom.xml
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/RSVPActivator.java
rsvp/impl/src/main/resources/OSGI-INF/blueprint/rsvp-impl.xml [deleted file]

index 95cb0974345855387ebd75f61506c925f3429a03..652aeea9885860a301036cfe4497187fbc530c8a 100644 (file)
             <groupId>org.kohsuke.metainf-services</groupId>
             <artifactId>metainf-services</artifactId>
         </dependency>
+        <dependency>
+            <groupId>javax.inject</groupId>
+            <artifactId>javax.inject</artifactId>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.cmpn</artifactId>
+        </dependency>
 
         <!-- Test dependencies -->
         <dependency>
index ba212bdb4d905ab2e830a242d53dc8e0387bdcaf..515ad0bc56462386ed3736ec7500e35fb10547ac 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.protocol.rsvp.parser.impl;
 
 import java.util.ArrayList;
 import java.util.List;
+import javax.inject.Inject;
+import javax.inject.Singleton;
 import org.kohsuke.MetaInfServices;
 import org.opendaylight.protocol.rsvp.parser.impl.subobject.ero.EROAsNumberSubobjectParser;
 import org.opendaylight.protocol.rsvp.parser.impl.subobject.ero.EROIpv4PrefixSubobjectParser;
@@ -100,9 +102,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.session.attribute.object.session.attribute.object.session.attribute.object.with.resources.affinities._case.SessionAttributeObjectWithResourcesAffinities;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.tspec.object.TspecObject;
 import org.opendaylight.yangtools.concepts.Registration;
+import org.osgi.service.component.annotations.Component;
 
+@Singleton
+@Component(immediate = true, service = RSVPExtensionProviderActivator.class,
+           property = "type=org.opendaylight.protocol.rsvp.parser.impl.RSVPActivator")
 @MetaInfServices(value = RSVPExtensionProviderActivator.class)
 public final class RSVPActivator extends AbstractRSVPExtensionProviderActivator {
+    @Inject
+    public RSVPActivator() {
+        // Exposed for DI
+    }
 
     @Override
     protected List<Registration> startImpl(final RSVPExtensionProviderContext context) {
diff --git a/rsvp/impl/src/main/resources/OSGI-INF/blueprint/rsvp-impl.xml b/rsvp/impl/src/main/resources/OSGI-INF/blueprint/rsvp-impl.xml
deleted file mode 100644 (file)
index 480e85d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2016 Brocade Communications Systems, Inc. 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
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
-
-  <bean id="RSVPActivator" class="org.opendaylight.protocol.rsvp.parser.impl.RSVPActivator"/>
-
-  <service ref="RSVPActivator" interface="org.opendaylight.protocol.rsvp.parser.spi.RSVPExtensionProviderActivator"
-          odl:type="org.opendaylight.protocol.rsvp.parser.impl.RSVPActivator"/>
-</blueprint>
\ No newline at end of file