X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2Fosgi%2FActivator.java;h=6f082b7ab186576c78c23b7e5c1c63df81d56b14;hb=cd50f92c60580b546a696aab7c3ff4fbf3f9a5f0;hp=d544d1fb3394c6e114a1b4cb398e9786e5332a93;hpb=250542ef463f05ba5c871c128afeb33c7af93ea8;p=controller.git diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/Activator.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/Activator.java index d544d1fb33..6f082b7ab1 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/Activator.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/Activator.java @@ -12,7 +12,9 @@ import static com.google.common.base.Preconditions.checkState; import java.util.Dictionary; import java.util.Hashtable; +import org.opendaylight.controller.netconf.api.util.NetconfConstants; import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory; +import org.opendaylight.yangtools.sal.binding.generator.util.BindingRuntimeContext; import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; @@ -28,7 +30,7 @@ public class Activator implements BundleActivator { private static final Logger LOG = LoggerFactory.getLogger(Activator.class); private BundleContext context; - private ServiceRegistration osgiRegistration; + private ServiceRegistration osgiRegistration; private ConfigRegistryLookupThread configRegistryLookup = null; @Override @@ -43,7 +45,7 @@ public class Activator implements BundleActivator { SchemaContextProvider schemaContextProvider = reference.getBundle().getBundleContext().getService(reference); - YangStoreServiceImpl yangStoreService = new YangStoreServiceImpl(schemaContextProvider); + YangStoreService yangStoreService = new YangStoreService(schemaContextProvider, context); configRegistryLookup = new ConfigRegistryLookupThread(yangStoreService); configRegistryLookup.start(); return configRegistryLookup; @@ -52,7 +54,9 @@ public class Activator implements BundleActivator { @Override public void modifiedService(ServiceReference reference, ConfigRegistryLookupThread configRegistryLookup) { LOG.debug("Got modifiedService(SchemaContextProvider) event"); - configRegistryLookup.yangStoreService.refresh(); + final BindingRuntimeContext runtimeContext = (BindingRuntimeContext) reference.getProperty(BindingRuntimeContext.class.getName()); + LOG.debug("BindingRuntimeContext retrieved as {}", runtimeContext); + configRegistryLookup.yangStoreService.refresh(runtimeContext); } @@ -79,9 +83,9 @@ public class Activator implements BundleActivator { } private class ConfigRegistryLookupThread extends Thread { - private final YangStoreServiceImpl yangStoreService; + private final YangStoreService yangStoreService; - private ConfigRegistryLookupThread(YangStoreServiceImpl yangStoreService) { + private ConfigRegistryLookupThread(YangStoreService yangStoreService) { super("config-registry-lookup"); this.yangStoreService = yangStoreService; } @@ -91,7 +95,7 @@ public class Activator implements BundleActivator { NetconfOperationServiceFactoryImpl factory = new NetconfOperationServiceFactoryImpl(yangStoreService); LOG.debug("Registering into OSGi"); Dictionary properties = new Hashtable<>(); - properties.put("name", "config-netconf-connector"); + properties.put(NetconfConstants.SERVICE_NAME, NetconfConstants.CONFIG_NETCONF_CONNECTOR); osgiRegistration = context.registerService(NetconfOperationServiceFactory.class, factory, properties); } }