Remove olm-blueprint.xml file 39/104939/5
authorGilles Thouenon <gilles.thouenon@orange.com>
Mon, 13 Mar 2023 16:59:55 +0000 (17:59 +0100)
committerguillaume.lambert <guillaume.lambert@orange.com>
Sun, 26 Mar 2023 20:57:45 +0000 (22:57 +0200)
Since now only OlmProvider remains, convert it to OSGi DS.

JIRA: TRNSPRTPCE-736
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: I51172cc98b35a5b74b5ec57c79675b974ae603d9

lighty/src/main/java/io/lighty/controllers/tpce/module/TransportPCEImpl.java
olm/src/main/java/org/opendaylight/transportpce/olm/OlmProvider.java
olm/src/main/resources/OSGI-INF/blueprint/olm-blueprint.xml [deleted file]

index bbd8f1950b6abba775d238261c45d92d0afac00a..2fcca728e6c30c849b95d41da70c4fd50ad34f2e 100644 (file)
@@ -241,8 +241,6 @@ public class TransportPCEImpl extends AbstractLightyModule implements TransportP
     protected boolean initProcedure() {
         LOG.info("Initializing PCE provider ...");
         pceProvider.init();
     protected boolean initProcedure() {
         LOG.info("Initializing PCE provider ...");
         pceProvider.init();
-        LOG.info("Initializing OLM provider ...");
-        olmProvider.init();
         LOG.info("Initializing renderer provider ...");
         rendererProvider.init();
         LOG.info("Initializing service-handler provider ...");
         LOG.info("Initializing renderer provider ...");
         rendererProvider.init();
         LOG.info("Initializing service-handler provider ...");
index 7ab54ce159a3fdd03f23d9a0aee18beee09047d3..3a33a43a35c9d1ed44a79967e9f380d394f85928 100644 (file)
@@ -11,16 +11,19 @@ package org.opendaylight.transportpce.olm;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
+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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * The Class OlmProvider.
  */
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * The Class OlmProvider.
  */
+@Component
 public class OlmProvider {
     private static final Logger LOG = LoggerFactory.getLogger(OlmProvider.class);
 public class OlmProvider {
     private static final Logger LOG = LoggerFactory.getLogger(OlmProvider.class);
-    private final RpcProviderService rpcProviderService;
-    private final TransportpceOlmService olmPowerServiceRpc;
     private ObjectRegistration<TransportpceOlmService> olmRPCRegistration;
 
     /**
     private ObjectRegistration<TransportpceOlmService> olmRPCRegistration;
 
     /**
@@ -30,24 +33,18 @@ public class OlmProvider {
      * @param rpcProviderService
      *            the rpc provider service
      */
      * @param rpcProviderService
      *            the rpc provider service
      */
-    public OlmProvider(final RpcProviderService rpcProviderService, final TransportpceOlmService olmPowerServiceRpc) {
-        this.rpcProviderService = rpcProviderService;
-        this.olmPowerServiceRpc = olmPowerServiceRpc;
-    }
-
-    /**
-     * Method called when the blueprint container is created.
-     */
-    public void init() {
-        LOG.info("OlmProvider Session Initiated");
-        // Initializing Notification module
+    @Activate
+    public OlmProvider(@Reference final RpcProviderService rpcProviderService,
+            @Reference final TransportpceOlmService olmPowerServiceRpc) {
         olmRPCRegistration = rpcProviderService.registerRpcImplementation(TransportpceOlmService.class,
         olmRPCRegistration = rpcProviderService.registerRpcImplementation(TransportpceOlmService.class,
-                this.olmPowerServiceRpc);
+                olmPowerServiceRpc);
+        LOG.info("OlmProvider Session Initiated");
     }
 
     /**
      * Method called when the blueprint container is destroyed.
      */
     }
 
     /**
      * Method called when the blueprint container is destroyed.
      */
+    @Deactivate
     public void close() {
         LOG.info("OlmProvider Closed");
         // Clean up the RPC service registration
     public void close() {
         LOG.info("OlmProvider Closed");
         // Clean up the RPC service registration
diff --git a/olm/src/main/resources/OSGI-INF/blueprint/olm-blueprint.xml b/olm/src/main/resources/OSGI-INF/blueprint/olm-blueprint.xml
deleted file mode 100644 (file)
index 252ac06..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright © 2016 Orange 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">
-  <reference id="rpcProviderService" interface="org.opendaylight.mdsal.binding.api.RpcProviderService" />
-  <reference id="olmPowerServiceImpl" interface="org.opendaylight.transportpce.olm.service.OlmPowerService" />
-  <reference id="olmPowerServiceRpcImpl" interface="org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService"/>
-
-  <bean id="provider" class="org.opendaylight.transportpce.olm.OlmProvider"
-        init-method="init" destroy-method="close">
-    <argument ref="rpcProviderService" />
-    <argument ref="olmPowerServiceRpcImpl" />
-  </bean>
-
-  </blueprint>