Remove dependency on controller config-util
[netconf.git] / netconf / netconf-impl / src / main / java / org / opendaylight / netconf / impl / osgi / AggregatedNetconfOperationServiceFactory.java
index 5c292b1f6e5b9f70a7cca773554166c845db1339..cd3aa6104e24ca777e83517b8e6f58075b4ec2e7 100644 (file)
@@ -20,7 +20,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import org.opendaylight.controller.config.util.capability.Capability;
+import org.opendaylight.netconf.api.capability.Capability;
 import org.opendaylight.netconf.api.monitoring.CapabilityListener;
 import org.opendaylight.netconf.mapping.api.NetconfOperation;
 import org.opendaylight.netconf.mapping.api.NetconfOperationService;
@@ -95,15 +95,12 @@ public class AggregatedNetconfOperationServiceFactory
         }
         listeners.add(listener);
 
-        return new AutoCloseable() {
-            @Override
-            public void close() throws Exception {
-                synchronized (AggregatedNetconfOperationServiceFactory.this) {
-                    listeners.remove(listener);
-                    CloseableUtil.closeAll(regs.values());
-                    for (final Map.Entry<NetconfOperationServiceFactory, AutoCloseable> reg : regs.entrySet()) {
-                        registrations.remove(reg.getKey(), reg.getValue());
-                    }
+        return () -> {
+            synchronized (AggregatedNetconfOperationServiceFactory.this) {
+                listeners.remove(listener);
+                CloseableUtil.closeAll(regs.values());
+                for (final Map.Entry<NetconfOperationServiceFactory, AutoCloseable> reg : regs.entrySet()) {
+                    registrations.remove(reg.getKey(), reg.getValue());
                 }
             }
         };