BUG-2453 (De)Serialize enum values as defined in yang
[controller.git] / opendaylight / netconf / config-netconf-connector / src / main / java / org / opendaylight / controller / netconf / confignetconfconnector / osgi / Activator.java
index 1579d1927fef673b116f2827940970e9cf9ab103..6f082b7ab186576c78c23b7e5c1c63df81d56b14 100644 (file)
@@ -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;
@@ -52,7 +54,9 @@ public class Activator implements BundleActivator {
             @Override
             public void modifiedService(ServiceReference<SchemaContextProvider> 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);
 
             }
 
@@ -91,7 +95,7 @@ public class Activator implements BundleActivator {
             NetconfOperationServiceFactoryImpl factory = new NetconfOperationServiceFactoryImpl(yangStoreService);
             LOG.debug("Registering into OSGi");
             Dictionary<String, String> 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);
         }
     }