Merge "OPNFLWPLUG-1046 : Migrate OFP from XML to annotation based blueprint"
authorArunprakash D <d.arunprakash@ericsson.com>
Thu, 29 Nov 2018 10:59:55 +0000 (10:59 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 29 Nov 2018 10:59:55 +0000 (10:59 +0000)
14 files changed:
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/device-ownership-state-service.xml [deleted file]
applications/forwardingrules-manager/pom.xml
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ForwardingRulesManagerImpl.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FrmReconciliationServiceImpl.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/recovery/impl/OpenflowServiceRecoveryHandlerImpl.java
applications/forwardingrules-manager/src/main/resources/OSGI-INF/blueprint/forwardingrules-manager.xml
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/mastership/MastershipChangeServiceManagerImpl.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImplTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/mastership/MastershipChangeServiceManagerImplTest.java
test-provider/pom.xml
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java
test-provider/src/main/resources/OSGI-INF/blueprint/test-provider.xml [deleted file]

index cfaf5729c44f3ee45d981d1e6e3a12184b81d906..518b9a2c681ef573b476a4ba4eb3c18af731efe5 100644 (file)
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>mdsal-eos-binding-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>javax.inject</groupId>
+            <artifactId>javax.inject</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 ec397ea82cb2c713b244a99ee5116417aed60580..c011a45a1ad6eb4fcaf08226367668ca59d846e6 100644 (file)
@@ -8,11 +8,15 @@
 package org.opendaylight.openflowplugin.applications.deviceownershipservice.impl;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
 import java.util.Optional;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 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;
@@ -22,6 +26,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.co
 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";
@@ -30,15 +36,17 @@ public class DeviceOwnershipServiceImpl implements DeviceOwnershipService, Entit
     private final EntityOwnershipService eos;
     private final ConcurrentMap<String, EntityOwnershipState> ownershipStateCache = new ConcurrentHashMap<>();
 
-    public DeviceOwnershipServiceImpl(final EntityOwnershipService entityOwnershipService) {
+    public DeviceOwnershipServiceImpl(@Reference final EntityOwnershipService entityOwnershipService) {
         this.eos = entityOwnershipService;
     }
 
+    @PostConstruct
     public void start() {
         registerEntityOwnershipListener();
         LOG.info("DeviceOwnershipService started");
     }
 
+    @PreDestroy
     public void close() {
         LOG.info("DeviceOwnershipService closed");
     }
diff --git a/applications/device-ownership-service/src/main/resources/OSGI-INF/blueprint/device-ownership-state-service.xml b/applications/device-ownership-service/src/main/resources/OSGI-INF/blueprint/device-ownership-state-service.xml
deleted file mode 100644 (file)
index 45bd17f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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="entityOwnershipService" interface="org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService"/>
-
-    <bean id="deviceOwnershipService" class="org.opendaylight.openflowplugin.applications.deviceownershipservice.impl.DeviceOwnershipServiceImpl"
-          init-method="start"
-          destroy-method="close">
-        <argument ref="entityOwnershipService"/>
-    </bean>
-
-    <service ref="deviceOwnershipService"
-             interface="org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService"
-             odl:type="default"/>
-
-</blueprint>
index 96911c92a8d52574e4f7c1fa3e193be4ae1a54e6..c492a6397059bd6744ff02d7fa27102b96e50d7d 100644 (file)
       <artifactId>arbitratorreconciliation-api</artifactId>
       <version>${project.version}</version>
     </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>
+
   <scm>
     <connection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</connection>
     <developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</developerConnection>
index 6deef293c323b01e5b3ec5f9779c6121730b1598..361b6e97153c7b41522a4207d35ae54dba1ebc98 100644 (file)
@@ -16,6 +16,11 @@ import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicLong;
 import javax.annotation.Nonnull;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import org.apache.aries.blueprint.annotation.service.Reference;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -61,6 +66,7 @@ import org.slf4j.LoggerFactory;
  * provide all RPC services.
  *
  */
+@Singleton
 public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
     private static final Logger LOG = LoggerFactory.getLogger(ForwardingRulesManagerImpl.class);
 
@@ -99,14 +105,16 @@ public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
     private final OpenflowServiceRecoveryHandler openflowServiceRecoveryHandler;
     private final ServiceRecoveryRegistry serviceRecoveryRegistry;
 
-    public ForwardingRulesManagerImpl(final DataBroker dataBroker, final RpcProviderRegistry rpcRegistry,
+    @Inject
+    public ForwardingRulesManagerImpl(@Reference final DataBroker dataBroker,
+                                      @Reference final RpcProviderRegistry rpcRegistry,
                                       final ForwardingRulesManagerConfig config,
-                                      final MastershipChangeServiceManager mastershipChangeServiceManager,
-                                      final ClusterSingletonServiceProvider clusterSingletonService,
-                                      final ConfigurationService configurationService,
-                                      final ReconciliationManager reconciliationManager,
+                                      @Reference final MastershipChangeServiceManager mastershipChangeServiceManager,
+                                      @Reference final ClusterSingletonServiceProvider clusterSingletonService,
+                                      @Reference final ConfigurationService configurationService,
+                                      @Reference final ReconciliationManager reconciliationManager,
                                       final OpenflowServiceRecoveryHandler openflowServiceRecoveryHandler,
-                                      final ServiceRecoveryRegistry serviceRecoveryRegistry) {
+                                      @Reference final ServiceRecoveryRegistry serviceRecoveryRegistry) {
         disableReconciliation = config.isDisableReconciliation();
         staleMarkingEnabled = config.isStaleMarkingEnabled();
         reconciliationRetryCount = config.getReconciliationRetryCount();
@@ -141,6 +149,7 @@ public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
     }
 
     @Override
+    @PostConstruct
     public void start() {
         nodeConfigurator = new NodeConfiguratorImpl();
         this.devicesGroupRegistry = new DevicesGroupRegistry();
@@ -167,6 +176,7 @@ public class ForwardingRulesManagerImpl implements ForwardingRulesManager {
     }
 
     @Override
+    @PreDestroy
     public void close() throws Exception {
         configurationServiceRegistration.close();
 
index 0af6532e9da3ea8998d7c558d9469cf61c0ca827..29856894be0d48ac72934376b25cecce888a4b27 100644 (file)
@@ -12,6 +12,10 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.apache.aries.blueprint.annotation.service.Service;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
@@ -29,12 +33,15 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@Singleton
+@Service(classes = FrmReconciliationService.class)
 public class FrmReconciliationServiceImpl implements FrmReconciliationService {
 
     private static final Logger LOG = LoggerFactory.getLogger(FrmReconciliationServiceImpl.class);
 
     private final ForwardingRulesManagerImpl forwardingRulesManagerImpl;
 
+    @Inject
     public FrmReconciliationServiceImpl(ForwardingRulesManagerImpl forwardingRulesManagerImpl) {
         this.forwardingRulesManagerImpl = forwardingRulesManagerImpl;
     }
index b9bd0f30831f78f121faf01ce9cb8681c8cdd54b..c1053e90d73693c594ba0c3c15701b2caff63da1 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.openflowplugin.applications.frm.recovery.impl;
 
 import javax.inject.Inject;
 import javax.inject.Singleton;
+import org.apache.aries.blueprint.annotation.service.Reference;
+import org.apache.aries.blueprint.annotation.service.Service;
 import org.opendaylight.openflowplugin.applications.frm.recovery.OpenflowServiceRecoveryHandler;
 import org.opendaylight.serviceutils.srm.RecoverableListener;
 import org.opendaylight.serviceutils.srm.ServiceRecoveryInterface;
@@ -18,6 +20,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Singleton
+@Service(classes = OpenflowServiceRecoveryHandler.class)
 public class OpenflowServiceRecoveryHandlerImpl implements ServiceRecoveryInterface,
         OpenflowServiceRecoveryHandler {
 
@@ -26,7 +29,7 @@ public class OpenflowServiceRecoveryHandlerImpl implements ServiceRecoveryInterf
     private final ServiceRecoveryRegistry serviceRecoveryRegistry;
 
     @Inject
-    public OpenflowServiceRecoveryHandlerImpl(final ServiceRecoveryRegistry serviceRecoveryRegistry) {
+    public OpenflowServiceRecoveryHandlerImpl(@Reference final ServiceRecoveryRegistry serviceRecoveryRegistry) {
         LOG.info("Registering openflowplugin service recovery handlers");
         this.serviceRecoveryRegistry = serviceRecoveryRegistry;
         serviceRecoveryRegistry.registerServiceRecoveryRegistry(buildServiceRegistryKey(), this);
index a848eafd54586e5c78cacd263a08e7126a84cdba..b69d74b2eba012570b1a1eefb6e71bcc2cf3e7d5 100644 (file)
@@ -4,43 +4,7 @@
            xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
         odl:use-default-for-reference-types="true">
 
-  <service ref="openflowServiceRecoveryHandler"
-           interface="org.opendaylight.openflowplugin.applications.frm.recovery.OpenflowServiceRecoveryHandler"
-           odl:type="default"/>
-  <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
-  <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
-  <reference id="clusterSingletonService" interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/>
-  <reference id="mastershipChangeServiceManager" interface="org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager"/>
-  <reference id="configurationService" interface="org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationService"/>
-  <reference id="reconciliationservice" interface="org.opendaylight.openflowplugin.applications.reconciliation.ReconciliationManager"/>
-  <reference id="serviceRecoveryRegistry" interface="org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry"/>
-
-  <odl:clustered-app-config id="frmConfig"
+  <odl:clustered-app-config id="forwardingRulesManagerConfig"
         binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.forwardingrules.manager.config.rev160511.ForwardingRulesManagerConfig"/>
 
-  <bean id="openflowServiceRecoveryHandler"
-        class="org.opendaylight.openflowplugin.applications.frm.recovery.impl.OpenflowServiceRecoveryHandlerImpl">
-    <argument ref="serviceRecoveryRegistry"/>
-  </bean>
-  <bean id="frmManager" class="org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerImpl"
-        init-method="start" destroy-method="close">
-    <argument ref="dataBroker"/>
-    <argument ref="rpcRegistry"/>
-    <argument ref="frmConfig"/>
-    <argument ref="mastershipChangeServiceManager"/>
-    <argument ref="clusterSingletonService"/>
-    <argument ref="configurationService"/>
-    <argument ref="reconciliationservice"/>
-    <argument ref="openflowServiceRecoveryHandler"/>
-    <argument ref="serviceRecoveryRegistry"/>
-  </bean>
-
-  <bean id="frmReconciliationService"
-          class="org.opendaylight.openflowplugin.applications.frm.impl.FrmReconciliationServiceImpl">
-    <argument ref="frmManager"/>
-  </bean>
-  <service ref="frmReconciliationService"
-           interface="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.frm.reconciliation.service.rev180227.FrmReconciliationService"
-           odl:type="default"/>
-
 </blueprint>
index 45e6bb2bec1db751cb8b1616cacaf115ee808a2c..72f3dbfde1fcc9b123c182163ee86fd493cf3e71 100644 (file)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.openflowplugin.impl.mastership;
 
+import static org.opendaylight.infrautils.utils.concurrent.LoggingFutures.addErrorLogging;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.util.concurrent.ListenableFuture;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 import javax.annotation.Nonnull;
@@ -24,11 +25,15 @@ import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeS
 import org.opendaylight.openflowplugin.api.openflow.mastership.ReconciliationFrameworkEvent;
 import org.opendaylight.openflowplugin.api.openflow.mastership.ReconciliationFrameworkRegistration;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.rf.state.rev170713.ResultState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @Singleton
 @Service(classes = MastershipChangeServiceManager.class)
 public final class MastershipChangeServiceManagerImpl implements MastershipChangeServiceManager {
 
+    private static final Logger LOG = LoggerFactory.getLogger(MastershipChangeServiceManagerImpl.class);
+
     private final List<MastershipChangeService> serviceGroup = new CopyOnWriteArrayList<>();
     private ReconciliationFrameworkEvent rfService = null;
     private MasterChecker masterChecker;
@@ -67,11 +72,13 @@ public final class MastershipChangeServiceManagerImpl implements MastershipChang
     }
 
     @Override
-    // FB flags this for onDeviceDisconnected but unclear why - seems a false positive.
-    @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
     public void becomeSlaveOrDisconnect(@Nonnull final DeviceInfo deviceInfo) {
         if (rfService != null) {
-            rfService.onDeviceDisconnected(deviceInfo);
+            ListenableFuture<Void> future = rfService.onDeviceDisconnected(deviceInfo);
+            // TODO This null future check here should ideally not be required, but some tests currently rely on it
+            if (future != null) {
+                addErrorLogging(future, LOG, "onDeviceDisconnected() failed");
+            }
         }
         serviceGroup.forEach(mastershipChangeService -> mastershipChangeService.onLoseOwnership(deviceInfo));
     }
index c7c0a62cb988b3479820c370ccda16c415ece983..9a1c30174d4d68f54d02f297afe98bb2ac1995fa 100644 (file)
@@ -85,11 +85,10 @@ public class ContextChainHolderImplTest {
 
     private ContextChainHolderImpl contextChainHolder;
     private ReconciliationFrameworkRegistration registration;
-    private MastershipChangeServiceManager manager = new MastershipChangeServiceManagerImpl();
+    private final MastershipChangeServiceManager manager = new MastershipChangeServiceManagerImpl();
 
     @Before
     public void setUp() throws Exception {
-
         Mockito.when(connectionContext.getDeviceInfo()).thenReturn(deviceInfo);
         Mockito.when(deviceManager.createContext(connectionContext)).thenReturn(deviceContext);
         Mockito.when(rpcManager.createContext(deviceContext)).thenReturn(rpcContext);
@@ -173,6 +172,9 @@ public class ContextChainHolderImplTest {
     @Test
     public void reconciliationFrameworkSuccessButNotSubmit() throws Exception {
         contextChainHolder.createContextChain(connectionContext);
+        // TODO when if (future != null) check in MastershipChangeServiceManagerImpl's becomeSlaveOrDisconnect() is rm
+        // Mockito.when(reconciliationFrameworkEvent.onDevicePrepared(deviceInfo))
+        //    .thenReturn(Futures.immediateFuture(null));
         contextChainHolder.createContextChain(connectionContext);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_FLOW_REGISTRY_FILL);
         contextChainHolder.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.RPC_REGISTRATION);
index 496935722238411b289c730fef069ddc54ade14b..4f78d953a37c27b5475928dbe467b57b88407133 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.mastership;
 
+import com.google.common.util.concurrent.Futures;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Assert;
@@ -49,6 +50,8 @@ public class MastershipChangeServiceManagerImplTest {
     public void setUp() throws Exception {
         registration = manager.register(service);
         registrationRF = manager.reconciliationFrameworkRegistration(event);
+
+        Mockito.when(event.onDeviceDisconnected(Mockito.any())).thenReturn(Futures.immediateFuture(null));
     }
 
     @Test
index 78e4436030ee88bd55879c84c2852ae9f317e7bd..df6aa2af1523fc00318b1f9d62606761c5a3323f 100644 (file)
             <groupId>commons-lang</groupId>
             <artifactId>commons-lang</artifactId>
           </dependency>
+        <dependency>
+            <groupId>javax.inject</groupId>
+            <artifactId>javax.inject</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>blueprint-maven-plugin-annotation</artifactId>
+            <optional>true</optional>
+        </dependency>
     </dependencies>
 
     <build>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.aries.blueprint</groupId>
+                <artifactId>blueprint-maven-plugin</artifactId>
+            </plugin>
         </plugins>
     </build>
 </project>
index 732bca02404af63056e8a9b932bb6ab25cd44409..a62774cef3e0a8402a5f2b71e7eb6f186b2d883b 100644 (file)
@@ -8,6 +8,10 @@
 
 package org.opendaylight.openflowplugin.test;
 
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Singleton;
+import org.apache.aries.blueprint.annotation.service.Reference;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
@@ -15,6 +19,7 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@Singleton
 public class OpenflowpluginTestActivator implements AutoCloseable {
     private static final Logger LOG = LoggerFactory
             .getLogger(OpenflowpluginTestActivator.class);
@@ -48,8 +53,8 @@ public class OpenflowpluginTestActivator implements AutoCloseable {
 
     public static final String NODE_ID = "foo:node:1";
 
-    public OpenflowpluginTestActivator(DataBroker dataBroker, NotificationProviderService notificationService,
-            BundleContext ctx) {
+    public OpenflowpluginTestActivator(@Reference DataBroker dataBroker,
+            @Reference NotificationProviderService notificationService, BundleContext ctx) {
         provider = new OpenflowpluginTestServiceProvider(dataBroker, notificationService);
         OpenflowpluginTestCommandProvider openflowpluginTestCommandProvider = new OpenflowpluginTestCommandProvider(
                 dataBroker, notificationService, ctx);
@@ -80,6 +85,7 @@ public class OpenflowpluginTestActivator implements AutoCloseable {
         this.groupCmdProvider = openflowPluginBulkGroupTransactionProvider;
     }
 
+    @PostConstruct
     public void init() {
         provider.register(rpcRegistry);
 
@@ -99,6 +105,7 @@ public class OpenflowpluginTestActivator implements AutoCloseable {
     }
 
     @Override
+    @PreDestroy
     @SuppressWarnings("checkstyle:IllegalCatch")
     public void close() {
         try {
diff --git a/test-provider/src/main/resources/OSGI-INF/blueprint/test-provider.xml b/test-provider/src/main/resources/OSGI-INF/blueprint/test-provider.xml
deleted file mode 100644 (file)
index d88f434..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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.controller.md.sal.binding.api.DataBroker"/>
-  <reference id="notificationService" interface="org.opendaylight.controller.sal.binding.api.NotificationProviderService"/>
-
-  <bean id="activator" class="org.opendaylight.openflowplugin.test.OpenflowpluginTestActivator"
-          init-method="init" destroy-method="close">
-    <argument ref="dataBroker"/>
-    <argument ref="notificationService"/>
-    <argument ref="blueprintBundleContext"/>
-  </bean>
-</blueprint>