HONEYCOMB-387: bind HoneycombNotification2Netconf as EagerSingleton 76/7976/1
authorMarek Gradzki <mgradzki@cisco.com>
Thu, 10 Aug 2017 11:09:48 +0000 (13:09 +0200)
committerMarek Gradzki <mgradzki@cisco.com>
Thu, 10 Aug 2017 11:09:51 +0000 (13:09 +0200)
https://gerrit.fd.io/r/#/c/7411/10 moved HoneycombNotification2Netconf
instance creation out of distribution's Main.

HoneycombNotification2Netconf is not used in any provider,
so needs to be initialized eagerly.

Change-Id: I1a5cfe6eb83b75a0b175052a8bda32eb4619218e
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfModule.java

index 01f57ed..d9a85cc 100644 (file)
@@ -122,7 +122,7 @@ public class NetconfModule extends NorthboundPrivateModule<NetconfConfiguration>
         // Create HC notification manager + HC2Netconf translator
         bind(NotificationCollector.class).toProvider(HoneycombNotificationManagerProvider.class).in(Singleton.class);
         bind(HoneycombNotification2NetconfProvider.HoneycombNotification2Netconf.class)
-                .toProvider(HoneycombNotification2NetconfProvider.class).in(Singleton.class);
+                .toProvider(HoneycombNotification2NetconfProvider.class).asEagerSingleton();
         expose(HoneycombNotification2NetconfProvider.HoneycombNotification2Netconf.class);
 
         configureServer();