Decouple config and netconf subsystems.
[controller.git] / opendaylight / netconf / netconf-impl / src / main / java / org / opendaylight / controller / config / yang / config / netconf / northbound / impl / NetconfServerDispatcherModule.java
index c1570f4311f67f9b7badfb609e30f55144e308bc..687ca933f000e5dde9001d15d7aaafdc47e1b41e 100644 (file)
@@ -2,12 +2,10 @@ package org.opendaylight.controller.config.yang.config.netconf.northbound.impl;
 
 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
 import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService;
-import org.opendaylight.controller.netconf.impl.CommitNotifier;
 import org.opendaylight.controller.netconf.impl.NetconfServerDispatcherImpl;
 import org.opendaylight.controller.netconf.impl.NetconfServerSessionNegotiatorFactory;
 import org.opendaylight.controller.netconf.impl.SessionIdProvider;
 import org.opendaylight.controller.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
-import org.opendaylight.controller.netconf.impl.osgi.NetconfMonitoringServiceImpl;
 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
 
 public class NetconfServerDispatcherModule extends org.opendaylight.controller.config.yang.config.netconf.northbound.impl.AbstractNetconfServerDispatcherModule {
@@ -28,9 +26,9 @@ public class NetconfServerDispatcherModule extends org.opendaylight.controller.c
     public java.lang.AutoCloseable createInstance() {
 
         final AggregatedNetconfOperationServiceFactory aggregatedOpProvider = getAggregatedOpProvider();
-        final NetconfMonitoringService monitoringService = startMonitoringService(aggregatedOpProvider);
+        final NetconfMonitoringService monitoringService = getServerMonitorDependency();
         final NetconfServerSessionNegotiatorFactory serverNegotiatorFactory = new NetconfServerSessionNegotiatorFactory(
-                getTimerDependency(), aggregatedOpProvider, new SessionIdProvider(), getConnectionTimeoutMillis(), CommitNotifier.NoopCommitNotifier.getInstance(), monitoringService);
+                getTimerDependency(), aggregatedOpProvider, new SessionIdProvider(), getConnectionTimeoutMillis(), monitoringService);
         final NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer = new NetconfServerDispatcherImpl.ServerChannelInitializer(
                 serverNegotiatorFactory);
 
@@ -44,10 +42,6 @@ public class NetconfServerDispatcherModule extends org.opendaylight.controller.c
 
     }
 
-    private NetconfMonitoringServiceImpl startMonitoringService(final AggregatedNetconfOperationServiceFactory netconfOperationProvider) {
-        return new NetconfMonitoringServiceImpl(netconfOperationProvider);
-    }
-
     private AggregatedNetconfOperationServiceFactory getAggregatedOpProvider() {
         final AggregatedNetconfOperationServiceFactory netconfOperationProvider = new AggregatedNetconfOperationServiceFactory();
         for (final NetconfOperationServiceFactory netconfOperationServiceFactory : getMappersDependency()) {