Call CreateSubscription close method on session end 91/37191/1
authorAndrej Mak <andmak@cisco.com>
Wed, 6 Apr 2016 12:56:06 +0000 (14:56 +0200)
committerAndrej Mak <andmak@cisco.com>
Wed, 6 Apr 2016 12:56:06 +0000 (14:56 +0200)
Change-Id: I5dc9138ef74f2b683bdde800f3aec0a3a291c621
Signed-off-by: Andrej Mak <andmak@cisco.com>
netconf/mdsal-netconf-notification/src/main/java/org/opendaylight/netconf/mdsal/notification/NetconfNotificationOperationService.java

index 94678c9d5589158ea859fa459d4cc8aa48cdadd8..9824e1e57bd14744820119355f594ba8d51e8e6e 100644 (file)
@@ -30,6 +30,14 @@ public class NetconfNotificationOperationService implements NetconfOperationServ
 
     @Override
     public void close() {
-
+        for (NetconfOperation netconfOperation : netconfOperations) {
+            if (netconfOperation instanceof AutoCloseable) {
+                try {
+                    ((AutoCloseable) netconfOperation).close();
+                } catch (Exception e) {
+                    throw new IllegalStateException("Exception while closing " + netconfOperation, e);
+                }
+            }
+        }
     }
 }