Ditch blueprint from srm-impl 55/97755/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 5 Oct 2021 18:06:01 +0000 (20:06 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 7 Oct 2021 09:17:32 +0000 (11:17 +0200)
We are using a dead plugin to generate half of wiring, with the rest
hand-written. Convert to OSGi DS, noticing a private method, which
really should be part of interface (in keeping with others).

This also fixes a TOCTOU race in removeRecoverableListener(), which
could lead to NPEs.

Since we are now SCR-enabled, we can ditch the use of ODL blueprint
extensions in shell, making everyone a bit happier.

Change-Id: Ia9d4d0fc3f0bc430d3a106f53975ab7d6e1241d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
srm/api/pom.xml
srm/api/src/main/java/org/opendaylight/serviceutils/srm/ServiceRecoveryRegistry.java
srm/impl/pom.xml
srm/impl/src/main/java/org/opendaylight/serviceutils/srm/impl/ServiceRecoveryListener.java
srm/impl/src/main/java/org/opendaylight/serviceutils/srm/impl/ServiceRecoveryManager.java [deleted file]
srm/impl/src/main/java/org/opendaylight/serviceutils/srm/impl/ServiceRecoveryRegistryImpl.java
srm/impl/src/main/java/org/opendaylight/serviceutils/srm/impl/SrmRpcProvider.java
srm/impl/src/main/resources/OSGI-INF/blueprint/srm.xml [deleted file]
srm/shell/pom.xml
srm/shell/src/main/java/org/opendaylight/serviceutils/srm/shell/RecoverCommand.java
srm/shell/src/main/java/org/opendaylight/serviceutils/srm/shell/ReinstallCommand.java
srm/shell/src/main/java/org/opendaylight/serviceutils/srm/shell/SrmDebugCommand.java
srm/shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml

index 346a4c47e75305af68741d7544e04a1345c038e6..1973faa6b08f86849e3c226da15c6bc7fff42de4 100644 (file)
@@ -16,9 +16,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <relativePath>../../commons/binding-parent</relativePath>
   </parent>
 
-  <groupId>org.opendaylight.serviceutils</groupId>
   <artifactId>srm-api</artifactId>
-  <version>0.9.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
   <!-- <name> formatting is used by autorelease to parse and notify projects on
        build failure. Please do not modify this unless you have a good reason. -->
index f5356a0c217ec8281c81527624d671d929278311..470ce3d2a7fa04f8a6ae7424ca7db6c849dfb352 100644 (file)
@@ -19,4 +19,6 @@ public interface ServiceRecoveryRegistry {
     void removeRecoverableListener(String serviceName, RecoverableListener recoverableListener);
 
     Queue<RecoverableListener> getRecoverableListeners(String serviceName);
+
+    ServiceRecoveryInterface getRegisteredServiceRecoveryHandler(String entityName);
 }
\ No newline at end of file
index f38f4f45dab1ca7bbd42418a3d9397b9130b1e98..e9d84bac589ae5e53a60d9d25d3c1252433694b1 100644 (file)
@@ -17,9 +17,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <relativePath>../../commons/quality-parent</relativePath>
   </parent>
 
-  <groupId>org.opendaylight.serviceutils</groupId>
   <artifactId>srm-impl</artifactId>
-  <version>0.9.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
   <!-- <name> formatting is used by autorelease to parse and notify projects on
        build failure. Please do not modify this unless you have a good reason. -->
@@ -51,19 +49,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <optional>true</optional>
     </dependency>
     <dependency>
-      <groupId>org.apache.aries.blueprint</groupId>
-      <artifactId>blueprint-maven-plugin-annotation</artifactId>
-      <scope>provided</scope>
+      <groupId>javax.annotation</groupId>
+      <artifactId>javax.annotation-api</artifactId>
       <optional>true</optional>
     </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.service.component.annotations</artifactId>
+    </dependency>
   </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.aries.blueprint</groupId>
-        <artifactId>blueprint-maven-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
 </project>
index 6d16a96a16b3d49ddefdf327baf4a51b9b7a9fe7..2284509fab1e486980f397b98657e199f91ec548 100644 (file)
@@ -12,40 +12,68 @@ import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry;
 import org.opendaylight.serviceutils.tools.mdsal.listener.AbstractClusteredSyncDataTreeChangeListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.ops.rev180626.ServiceOps;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.ops.rev180626.service.ops.Services;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.ops.rev180626.service.ops.services.Operations;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.types.rev180626.EntityNameBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.types.rev180626.EntityTypeBase;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
-public class ServiceRecoveryListener extends AbstractClusteredSyncDataTreeChangeListener<Operations> {
-
+@Component
+@RequireServiceComponentRuntime
+public final class ServiceRecoveryListener extends AbstractClusteredSyncDataTreeChangeListener<Operations> {
     private static final Logger LOG = LoggerFactory.getLogger(ServiceRecoveryListener.class);
 
-    private final ServiceRecoveryManager serviceRecoveryManager;
+    private final ServiceRecoveryRegistry serviceRecoveryRegistry;
 
     @Inject
-    public ServiceRecoveryListener(DataBroker dataBroker, ServiceRecoveryManager serviceRecoveryManager) {
+    @Activate
+    public ServiceRecoveryListener(@Reference DataBroker dataBroker,
+                                   @Reference ServiceRecoveryRegistry serviceRecoveryRegistry) {
         super(dataBroker, LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(ServiceOps.class)
                 .child(Services.class).child(Operations.class));
-        this.serviceRecoveryManager = serviceRecoveryManager;
+        this.serviceRecoveryRegistry = serviceRecoveryRegistry;
     }
 
     @Override
+    @Deprecated
     public void add(InstanceIdentifier<Operations> instanceIdentifier, Operations operations) {
         LOG.info("Service Recovery operation triggered for service: {}", operations);
-        serviceRecoveryManager.recoverService(operations.getEntityType(), operations.getEntityName(),
-                operations.getEntityId());
+        recoverService(operations.getEntityType(), operations.getEntityName(), operations.getEntityId());
+    }
+
+    /**
+     * Initiates recovery mechanism for a particular interface-manager entity. This method tries to check whether there
+     * is a registered handler for the incoming service recovery request within interface-manager and redirects the call
+     * to the respective handler if found.
+     *
+     * @param entityType The type of service recovery. eg :SERVICE or INSTANCE.
+     * @param entityName The type entity for which recovery has to be started. eg : INTERFACE or DPN.
+     * @param entityId The unique id to represent the entity to be recovered
+     */
+    private void recoverService(Class<? extends EntityTypeBase> entityType,
+                                Class<? extends EntityNameBase> entityName, String entityId) {
+        String serviceRegistryKey = entityName.toString();
+        serviceRecoveryRegistry.getRegisteredServiceRecoveryHandler(serviceRegistryKey).recoverService(entityId);
     }
 
     @Override
+    @Deprecated
     public void remove(InstanceIdentifier<Operations> instanceIdentifier, Operations removedDataObject) {
+        // FIXME: this should be doing something, right?
     }
 
     @Override
+    @Deprecated
     public void update(InstanceIdentifier<Operations> instanceIdentifier,
                        Operations originalDataObject, Operations updatedDataObject) {
         add(instanceIdentifier, updatedDataObject);
diff --git a/srm/impl/src/main/java/org/opendaylight/serviceutils/srm/impl/ServiceRecoveryManager.java b/srm/impl/src/main/java/org/opendaylight/serviceutils/srm/impl/ServiceRecoveryManager.java
deleted file mode 100644 (file)
index c84edcc..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2018 Ericsson India Global Services Pvt Ltd. 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
- */
-package org.opendaylight.serviceutils.srm.impl;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.types.rev180626.EntityNameBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.types.rev180626.EntityTypeBase;
-
-@Singleton
-public final class ServiceRecoveryManager {
-
-    private final ServiceRecoveryRegistryImpl serviceRecoveryRegistry;
-
-    @Inject
-    public ServiceRecoveryManager(ServiceRecoveryRegistryImpl serviceRecoveryRegistry) {
-        this.serviceRecoveryRegistry = serviceRecoveryRegistry;
-    }
-
-    private static String getServiceRegistryKey(Class<? extends EntityNameBase> entityName) {
-        return entityName.toString();
-    }
-
-    /**
-     * Initiates recovery mechanism for a particular interface-manager entity.
-     * This method tries to check whether there is a registered handler for the incoming
-     * service recovery request within interface-manager and redirects the call
-     * to the respective handler if found.
-     *  @param entityType
-     *            The type of service recovery. eg :SERVICE or INSTANCE.
-     * @param entityName
-     *            The type entity for which recovery has to be started. eg : INTERFACE or DPN.
-     * @param entityId
-     *            The unique id to represent the entity to be recovered
-     */
-    public void recoverService(Class<? extends EntityTypeBase> entityType,
-                                      Class<? extends EntityNameBase> entityName, String entityId) {
-        String serviceRegistryKey = getServiceRegistryKey(entityName);
-        serviceRecoveryRegistry.getRegisteredServiceRecoveryHandler(serviceRegistryKey).recoverService(entityId);
-    }
-}
index df9013f816bcdb6729582813a68e693f054e68f3..2fd95d6befeb09112a6cb5929b628e9c11e175a0 100644 (file)
@@ -11,18 +11,21 @@ import java.util.Map;
 import java.util.Queue;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
+import javax.inject.Inject;
 import javax.inject.Singleton;
-import org.apache.aries.blueprint.annotation.service.Service;
 import org.opendaylight.serviceutils.srm.RecoverableListener;
 import org.opendaylight.serviceutils.srm.ServiceRecoveryInterface;
 import org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
-@Service(classes = ServiceRecoveryRegistry.class)
-public class ServiceRecoveryRegistryImpl implements ServiceRecoveryRegistry {
-
+@Component(immediate = true)
+@RequireServiceComponentRuntime
+public final class ServiceRecoveryRegistryImpl implements ServiceRecoveryRegistry {
     private static final Logger LOG = LoggerFactory.getLogger(ServiceRecoveryRegistryImpl.class);
 
     private final Map<String, ServiceRecoveryInterface> serviceRecoveryRegistry = new ConcurrentHashMap<>();
@@ -30,9 +33,14 @@ public class ServiceRecoveryRegistryImpl implements ServiceRecoveryRegistry {
     private final Map<String, Queue<RecoverableListener>> recoverableListenersMap =
             new ConcurrentHashMap<>();
 
+    @Inject
+    @Activate
+    public ServiceRecoveryRegistryImpl() {
+        // Exposed for DI
+    }
+
     @Override
-    public void registerServiceRecoveryRegistry(String entityName,
-                                                ServiceRecoveryInterface serviceRecoveryHandler) {
+    public void registerServiceRecoveryRegistry(String entityName, ServiceRecoveryInterface serviceRecoveryHandler) {
         serviceRecoveryRegistry.put(entityName, serviceRecoveryHandler);
         LOG.trace("Registered service recovery handler for {}", entityName);
     }
@@ -46,8 +54,9 @@ public class ServiceRecoveryRegistryImpl implements ServiceRecoveryRegistry {
 
     @Override
     public void removeRecoverableListener(String serviceName, RecoverableListener recoverableListener) {
-        if (recoverableListenersMap.get(serviceName) != null) {
-            recoverableListenersMap.get(serviceName).remove(recoverableListener);
+        Queue<RecoverableListener> queue = getRecoverableListeners(serviceName);
+        if (queue != null) {
+            queue.remove(recoverableListener);
         }
     }
 
@@ -56,7 +65,8 @@ public class ServiceRecoveryRegistryImpl implements ServiceRecoveryRegistry {
         return recoverableListenersMap.get(serviceName);
     }
 
-    ServiceRecoveryInterface getRegisteredServiceRecoveryHandler(String entityName) {
+    @Override
+    public ServiceRecoveryInterface getRegisteredServiceRecoveryHandler(String entityName) {
         return serviceRecoveryRegistry.get(entityName);
     }
 }
index e18a8fcca2c8e35f3b4b585a9d357e686ef22208..0f0bc178f84c168f50d9a1933ff8145bd9b79ceb 100644 (file)
@@ -8,27 +8,48 @@
 package org.opendaylight.serviceutils.srm.impl;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.serviceutils.tools.rpc.FutureRpcResults;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpc.rev180626.OdlSrmRpcsService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpc.rev180626.RecoverInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpc.rev180626.RecoverOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpc.rev180626.ReinstallInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpc.rev180626.ReinstallOutput;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
-public class SrmRpcProvider implements OdlSrmRpcsService {
+@Component(immediate = true, service = OdlSrmRpcsService.class)
+@RequireServiceComponentRuntime
+public final class SrmRpcProvider implements OdlSrmRpcsService, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(SrmRpcProvider.class);
+
     private final DataBroker dataBroker;
+    private final Registration reg;
 
     @Inject
-    public SrmRpcProvider(DataBroker dataBroker) {
+    @Activate
+    public SrmRpcProvider(@Reference DataBroker dataBroker, @Reference RpcProviderService rpcProvider) {
         this.dataBroker = dataBroker;
+        reg = rpcProvider.registerRpcImplementation(OdlSrmRpcsService.class, this);
+    }
+
+    @Override
+    @Deactivate
+    @PreDestroy
+    public void close() {
+        reg.close();
     }
 
     @Override
diff --git a/srm/impl/src/main/resources/OSGI-INF/blueprint/srm.xml b/srm/impl/src/main/resources/OSGI-INF/blueprint/srm.xml
deleted file mode 100644 (file)
index c07d334..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright © 2017 Ericsson India Global Services Pvt Ltd. 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"
-           odl:use-default-for-reference-types="true">
-
-    <reference id="dataBroker"
-               interface="org.opendaylight.mdsal.binding.api.DataBroker" />
-
-    <odl:rpc-implementation ref="srmRpcProvider" />
-
-</blueprint>
index 947a2060de544374b215df77c05883c10fa328ca..00daa8d29662354efbcfb6eaffb2c04ae93dbfa9 100644 (file)
@@ -16,9 +16,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <relativePath>../../commons/quality-parent</relativePath>
   </parent>
 
-  <groupId>org.opendaylight.serviceutils</groupId>
   <artifactId>srm-shell</artifactId>
-  <version>0.9.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
   <!-- <name> formatting is used by autorelease to parse and notify projects on
        build failure. Please do not modify this unless you have a good reason. -->
index e7d54b82b8c0900f6dc096b1425db8bb06328603..4769d5c55dff3a373c1e8fe42fe0cdd300ea1c80 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.serviceutils.srm.shell;
 
 import java.util.concurrent.Future;
@@ -25,25 +24,22 @@ import org.slf4j.LoggerFactory;
 
 @Command(scope = "srm", name = "recover", description = "Recover service or instance")
 public class RecoverCommand extends OsgiCommandSupport {
-
     private static final Logger LOG = LoggerFactory.getLogger(RecoverCommand.class);
 
-    private final OdlSrmRpcsService srmRpcService;
-
-    public RecoverCommand(OdlSrmRpcsService srmRpcService) {
-        this.srmRpcService = srmRpcService;
-    }
-
     @Argument(index = 0, name = "type", description = "EntityType, required", required = false, multiValued = false)
     String type;
-
     @Argument(index = 1, name = "name", description = "EntityName, required", required = false, multiValued = false)
     String name;
-
     @Argument(index = 2, name = "id", description = "EntityId, optional", required = false, multiValued = false)
     String id;
+    private final OdlSrmRpcsService srmRpcService;
+
+    public RecoverCommand(OdlSrmRpcsService srmRpcService) {
+        this.srmRpcService = srmRpcService;
+    }
 
     @Override
+    @Deprecated
     protected @Nullable Object doExecute() throws Exception {
         RecoverInput input = getInput();
         if (input == null) {
@@ -92,5 +88,4 @@ public class RecoverCommand extends OsgiCommandSupport {
         }
         return inputBuilder.build();
     }
-
 }
index 973733bef176d34e8d73fa6bf6a7c2e3608d8b2c..42f46c43a34d6d82563feb91c4424bb17f754fbc 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.serviceutils.srm.shell;
 
 import java.util.concurrent.Future;
@@ -26,9 +25,12 @@ import org.slf4j.LoggerFactory;
 
 @Command(scope = "srm", name = "reinstall", description = "Reinstall service or instance")
 public class ReinstallCommand extends OsgiCommandSupport {
-
     private static final Logger LOG = LoggerFactory.getLogger(ReinstallCommand.class);
 
+    @Argument(index = 0, name = "name", description = "EntityName of type service, required",
+        required = false, multiValued = false)
+    String name;
+
     private final OdlSrmRpcsService srmRpcService;
     private final Class<? extends EntityTypeBase> entityType = EntityTypeService.class;
 
@@ -36,11 +38,8 @@ public class ReinstallCommand extends OsgiCommandSupport {
         this.srmRpcService = srmRpcService;
     }
 
-    @Argument(index = 0, name = "name", description = "EntityName of type service, required",
-        required = false, multiValued = false)
-    String name;
-
     @Override
+    @Deprecated
     protected @Nullable Object doExecute() throws Exception {
         ReinstallInput input = getInput();
         if (input == null) {
@@ -77,5 +76,4 @@ public class ReinstallCommand extends OsgiCommandSupport {
         inputBuilder.setEntityName(entityName);
         return inputBuilder.build();
     }
-
 }
index 52741e29d11f1454ee3e18a0d70e4eb8b5a3d70f..55814751a36c8c7affc1fcc36103fa5851d0df96 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.serviceutils.srm.shell;
 
 import org.apache.karaf.shell.commands.Command;
@@ -18,25 +17,20 @@ import org.opendaylight.mdsal.binding.api.WriteTransaction;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.ops.rev180626.ServiceOps;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 @Command(scope = "srm", name = "debug", description = "SRM debug commands")
 public class SrmDebugCommand extends OsgiCommandSupport {
-
-    private static final Logger LOG = LoggerFactory.getLogger(SrmDebugCommand.class);
-
+    @Option(name = "-c", aliases = {"--clear-ops"}, description = "Clear operations DS",
+        required = true, multiValued = false)
+    boolean clearOps;
     private final DataBroker txDataBroker;
 
     public SrmDebugCommand(DataBroker dataBroker) {
-        this.txDataBroker = dataBroker;
+        txDataBroker = dataBroker;
     }
 
-    @Option(name = "-c", aliases = {"--clear-ops"}, description = "Clear operations DS",
-        required = true, multiValued = false)
-    boolean clearOps;
-
     @Override
+    @Deprecated
     protected @Nullable Object doExecute() throws Exception {
         if (clearOps) {
             clearOpsDs();
index c3da29b6edf177204ae28aa520e154d29a5108eb..d11585551bd9536682ae68ae83163b7e4de29a74 100644 (file)
@@ -5,25 +5,21 @@
         * 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"
-           odl:use-default-for-reference-types="true">
-
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
     <reference id="dataBroker"
                interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
-
-    <odl:rpc-service id="srmRpcService"
-             interface="org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpc.rev180626.OdlSrmRpcsService" />
+    <reference id="srmRpcService"
+               interface="org.opendaylight.yang.gen.v1.urn.opendaylight.serviceutils.srm.rpc.rev180626.OdlSrmRpcsService"/>
 
     <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
             <action class="org.opendaylight.serviceutils.srm.shell.RecoverCommand">
-                <argument ref="srmRpcService" />
+                <argument ref="srmRpcService"/>
             </action>
         </command>
         <command>
             <action class="org.opendaylight.serviceutils.srm.shell.ReinstallCommand">
-                <argument ref="srmRpcService" />
+                <argument ref="srmRpcService"/>
             </action>
         </command>
         <command>