Bug:441-closing listener on stop of md-topologymaneger bundle 01/5701/2
authorKamal Rameshan <kramesha@cisco.com>
Thu, 20 Mar 2014 20:36:09 +0000 (13:36 -0700)
committerKamal Rameshan <kramesha@cisco.com>
Wed, 26 Mar 2014 19:02:46 +0000 (12:02 -0700)
Change-Id: Ic4081b36a557110f6daeb7a6fb8a3b39ee1be8b2
Signed-off-by: Kamal Rameshan <kramesha@cisco.com>
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyProvider.xtend

index 036fe733aa80b56ac7cc2302d9a26cab0d2703ac..73e03d1e7d208287c1bed8505f889fbe470c8fa8 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.yangtools.yang.binding.NotificationListener
 import org.slf4j.LoggerFactory
 import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
+import org.osgi.framework.BundleContext;
 
 class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implements AutoCloseable {
 
@@ -35,7 +36,11 @@ class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implement
        LOG.info("FlowCapableTopologyProvider stopped.");
         listenerRegistration?.close();
     }
-    
+
+     /**
+       * Gets called on start of a bundle.
+       * @param session
+       */
     override onSessionInitiated(ProviderContext session) {
         dataService = session.getSALService(DataProviderService)
         notificationService = session.getSALService(NotificationProviderService)
@@ -43,6 +48,14 @@ class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implement
         exporter.start();
         listenerRegistration = notificationService.registerNotificationListener(exporter);
     }
+
+    /**
+      * Gets called during stop bundle
+      * @param context The execution context of the bundle being stopped.
+      */
+    override stopImpl(BundleContext context) {
+        close();
+    }
     
 }