diff options
author | Jan Srnicek <jsrnicek@cisco.com> | 2017-08-10 14:39:30 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2017-08-14 07:01:06 +0000 |
commit | 6923420946f05308af6a073d270df41d069dd532 (patch) | |
tree | d5e233246a792d223e92253bcc19f1b9b579cc8b /infra/northbound/netconf | |
parent | d0688f2883b3231e743dcd53bbf2203ec4639c6e (diff) |
Shutdown closing of resources
Change-Id: If57a5414153cb983138872c7a1ded7c7066b1b6d
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'infra/northbound/netconf')
-rw-r--r-- | infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java | 8 |
1 files changed, 7 insertions, 1 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 d097e3419..e402f046d 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 @@ -19,6 +19,7 @@ package io.fd.honeycomb.northbound.netconf; import com.google.inject.Inject; import com.google.inject.name.Named; import io.fd.honeycomb.binding.init.ProviderTrait; +import io.fd.honeycomb.data.init.ShutdownHandler; import org.opendaylight.controller.config.yang.netconf.mdsal.notification.CapabilityChangeNotificationProducer; import org.opendaylight.controller.config.yang.netconf.mdsal.notification.NotificationToMdsalWriter; import org.opendaylight.controller.md.sal.binding.api.DataBroker; @@ -54,6 +55,8 @@ public class NetconfNotificationMapperProvider extends ProviderTrait<NetconfOper private DataBroker dataBroker; @Inject private NetconfOperationServiceFactoryListener aggregator; + @Inject + private ShutdownHandler shutdownHandler; @Override protected NetconfNotificationOperationServiceFactory create() { @@ -68,6 +71,9 @@ public class NetconfNotificationMapperProvider extends ProviderTrait<NetconfOper LOG.trace("Providing NetconfNotificationOperationServiceFactory"); NetconfNotificationOperationServiceFactory netconfNotificationOperationServiceFactory = new NetconfNotificationOperationServiceFactory(notificationRegistry, aggregator); - return netconfNotificationOperationServiceFactory; + + shutdownHandler.register("netconf-notification-service-factory", netconfNotificationOperationServiceFactory); + shutdownHandler.register("notification-to-mdsal-writer", writer); + return netconfNotificationOperationServiceFactory; } } |