Merge "bug 433 NPE in onGlobalContextUpdated of ControllerContext class"
[controller.git] / opendaylight / netconf / netconf-impl / src / main / java / org / opendaylight / controller / netconf / impl / osgi / NetconfImplActivator.java
index abebacf974d0527b72d6479fb2e83796e18aedd4..b8dc9550c7f1fff5b4a544d3be0bc68f07f6d235 100644 (file)
@@ -26,6 +26,7 @@ import java.lang.management.ManagementFactory;
 import java.net.InetSocketAddress;
 import java.util.Dictionary;
 import java.util.Hashtable;
+import java.util.concurrent.TimeUnit;
 
 public class NetconfImplActivator implements BundleActivator {
 
@@ -48,8 +49,9 @@ public class NetconfImplActivator implements BundleActivator {
 
         SessionIdProvider idProvider = new SessionIdProvider();
         timer = new HashedWheelTimer();
+        long connectionTimeoutMillis = NetconfConfigUtil.extractTimeoutMillis(context);
         NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory(
-                timer, factoriesListener, idProvider);
+                timer, factoriesListener, idProvider, connectionTimeoutMillis);
 
         commitNot = new DefaultCommitNotificationProducer(ManagementFactory.getPlatformMBeanServer());
 
@@ -87,7 +89,7 @@ public class NetconfImplActivator implements BundleActivator {
         logger.info("Shutting down netconf because YangStoreService service was removed");
 
         commitNot.close();
-        eventLoopGroup.shutdownGracefully();
+        eventLoopGroup.shutdownGracefully(0, 1, TimeUnit.SECONDS);
         timer.stop();
 
         regMonitoring.unregister();