From c2401400ef8237a2208fb5a4ef219172b880ad96 Mon Sep 17 00:00:00 2001 From: Gilles Thouenon Date: Tue, 14 Mar 2023 18:28:00 +0100 Subject: [PATCH] Turn ServiceDataStoreOperationsImpl into Component JIRA: TRNSPRTPCE-736 Signed-off-by: Gilles Thouenon Change-Id: I70cf38993e3e20445b398078f7a4c46b1afedba5 (cherry picked from commit 1bb411b2d1b153a9d3be27081daf3e624c507c68) --- servicehandler/pom.xml | 4 ++++ .../service/ServiceDataStoreOperationsImpl.java | 7 ++++++- .../OSGI-INF/blueprint/servicehandler-blueprint.xml | 7 +------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/servicehandler/pom.xml b/servicehandler/pom.xml index 8159b11dc..5943a7144 100644 --- a/servicehandler/pom.xml +++ b/servicehandler/pom.xml @@ -106,6 +106,10 @@ Author: Martial Coulibaly on behalf of Orange com.google.guava guava + + org.osgi + org.osgi.service.component.annotations + diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java index 49b631d2a..be0c5d7ee 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java @@ -41,9 +41,13 @@ import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder; import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey; 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.slf4j.Logger; import org.slf4j.LoggerFactory; +@Component(immediate = true) public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperations { private static final Logger LOG = LoggerFactory.getLogger(ServiceDataStoreOperationsImpl.class); private static final String CREATE_MSG = "create"; @@ -73,7 +77,8 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation } - public ServiceDataStoreOperationsImpl(DataBroker dataBroker) { + @Activate + public ServiceDataStoreOperationsImpl(@Reference DataBroker dataBroker) { this.dataBroker = dataBroker; } diff --git a/servicehandler/src/main/resources/OSGI-INF/blueprint/servicehandler-blueprint.xml b/servicehandler/src/main/resources/OSGI-INF/blueprint/servicehandler-blueprint.xml index 1de4c6a4e..36dd8343c 100644 --- a/servicehandler/src/main/resources/OSGI-INF/blueprint/servicehandler-blueprint.xml +++ b/servicehandler/src/main/resources/OSGI-INF/blueprint/servicehandler-blueprint.xml @@ -29,10 +29,7 @@ Author: Martial Coulibaly on behalf of Orange - - - - + @@ -85,6 +82,4 @@ Author: Martial Coulibaly on behalf of Orange - -- 2.36.6