summaryrefslogtreecommitdiffstats
path: root/infra
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-05-16 08:16:02 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-05-18 06:42:32 +0000
commit322748d3fb36a0e7e1a2bc2c4e9ca7a5805c7d7c (patch)
treeede48e2564159999c717ac033a7891adf7a8eae2 /infra
parentdea26601bb63731c35675366849c40960e48992a (diff)
Invoke CapabilityChangeNotificationProducer.close on shutdown
Also fixes Sonar warning regarding useless CapabilityChangeNotificationProducer instantiation. Change-Id: I376b834618d34f13615051abf622e6b12e031050 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra')
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
index 49e94bb..f64e4b0 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
@@ -64,13 +64,16 @@ public class NetconfNotificationMapperProvider extends ProviderTrait<NetconfOper
writer.start();
LOG.trace("Initializing CapabilityChangeNotificationProducer");
- new CapabilityChangeNotificationProducer(notificationCollector, dataBroker);
+ final CapabilityChangeNotificationProducer capabilityChangeNotificationProducer =
+ new CapabilityChangeNotificationProducer(notificationCollector, dataBroker);
LOG.trace("Providing NetconfNotificationOperationServiceFactory");
- NetconfNotificationOperationServiceFactory netconfNotificationOperationServiceFactory =
+ final NetconfNotificationOperationServiceFactory netconfNotificationOperationServiceFactory =
new NetconfNotificationOperationServiceFactory(notificationRegistry, aggregator);
shutdownHandler.register("netconf-notification-service-factory", netconfNotificationOperationServiceFactory);
+ shutdownHandler.register("capability-change-notification-producer",
+ capabilityChangeNotificationProducer::close);
shutdownHandler.register("notification-to-mdsal-writer", writer);
return netconfNotificationOperationServiceFactory;
}