summaryrefslogtreecommitdiffstats
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:45 +0000
commitd47a577e0155f4dd0aeb6f1adf7cda83ef59e8c5 (patch)
tree21d8c8441bfdc38de297833df6c624ff35aaee19
parent0c83ec168d17d7296a3c1e4e1e3983dc932688b6 (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> (cherry picked from commit 322748d3fb36a0e7e1a2bc2c4e9ca7a5805c7d7c)
-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 49e94bbb4..f64e4b020 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;
}