Fix mdsal-netconf-ssh shutdown
[netconf.git] / netconf / mdsal-netconf-ssh / src / main / java / org / opendaylight / netconf / ssh / SshProxyServer.java
index cdc730fc17370d6c57a034d31aefadebd3bb20cf..c429620d2ea1f64e1868bc6b9bfc7023a6866426 100644 (file)
@@ -52,8 +52,8 @@ public class SshProxyServer implements AutoCloseable {
             final IoServiceFactoryFactory serviceFactory) {
         this.minaTimerExecutor = minaTimerExecutor;
         this.clientGroup = clientGroup;
-        this.nioServiceWithPoolFactoryFactory = serviceFactory;
-        this.sshServer = SshServer.setUpDefaultServer();
+        nioServiceWithPoolFactoryFactory = serviceFactory;
+        sshServer = SshServer.setUpDefaultServer();
     }
 
     public SshProxyServer(final ScheduledExecutorService minaTimerExecutor,
@@ -179,10 +179,10 @@ public class SshProxyServer implements AutoCloseable {
     }
 
     private static final class NioServiceWithPoolFactoryFactory extends Nio2ServiceFactoryFactory {
-        private final ExecutorService nioExecutor;
+        private final ExecutorServiceFacade nioExecutor;
 
         NioServiceWithPoolFactoryFactory(final ExecutorService nioExecutor) {
-            this.nioExecutor = nioExecutor;
+            this.nioExecutor = new ExecutorServiceFacade(nioExecutor);
         }
 
         @Override