summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
9d92243)
Rather than subclassing, instantiate a Hashtable and fill it.
Change-Id: Icfd4e812759874a702a2506e9090cd20535bdc50
Signed-off-by: Robert Varga <rovarga@cisco.com>
package org.opendaylight.controller.config.manager.impl.osgi.mapping;
package org.opendaylight.controller.config.manager.impl.osgi.mapping;
+import java.util.Dictionary;
import java.util.Hashtable;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.sal.binding.generator.api.ClassLoadingStrategy;
import java.util.Hashtable;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.sal.binding.generator.api.ClassLoadingStrategy;
if(osgiReg != null) {
try {
bindingContextProvider.update(classLoadingStrat, schemaContextProvider);
if(osgiReg != null) {
try {
bindingContextProvider.update(classLoadingStrat, schemaContextProvider);
- osgiReg.setProperties(new Hashtable<String, Object>() {{
- put(BindingRuntimeContext.class.getName(), bindingContextProvider.getBindingContext());
- put(SchemaSourceProvider.class.getName(), sourceProvider);
- }}); // send modifiedService event
+
+ final Dictionary<String, Object> props = new Hashtable<>();
+ props.put(BindingRuntimeContext.class.getName(), bindingContextProvider.getBindingContext());
+ props.put(SchemaSourceProvider.class.getName(), sourceProvider);
+ osgiReg.setProperties(props); // send modifiedService event
} catch (RuntimeException e) {
// The ModuleInfoBackedContext throws a RuntimeException if it can't create the schema context.
LOG.warn("Error updating the BindingContextProvider", e);
} catch (RuntimeException e) {
// The ModuleInfoBackedContext throws a RuntimeException if it can't create the schema context.
LOG.warn("Error updating the BindingContextProvider", e);
- public ObjectRegistration<YangModuleInfo> registerModuleInfo(YangModuleInfo yangModuleInfo) {
+ public ObjectRegistration<YangModuleInfo> registerModuleInfo(final YangModuleInfo yangModuleInfo) {
ObjectRegistration<YangModuleInfo> yangModuleInfoObjectRegistration = moduleInfoRegistry.registerModuleInfo(yangModuleInfo);
ObjectRegistrationWrapper wrapper = new ObjectRegistrationWrapper(yangModuleInfoObjectRegistration);
return wrapper;
ObjectRegistration<YangModuleInfo> yangModuleInfoObjectRegistration = moduleInfoRegistry.registerModuleInfo(yangModuleInfo);
ObjectRegistrationWrapper wrapper = new ObjectRegistrationWrapper(yangModuleInfoObjectRegistration);
return wrapper;
private class ObjectRegistrationWrapper implements ObjectRegistration<YangModuleInfo> {
private final ObjectRegistration<YangModuleInfo> inner;
private class ObjectRegistrationWrapper implements ObjectRegistration<YangModuleInfo> {
private final ObjectRegistration<YangModuleInfo> inner;
- private ObjectRegistrationWrapper(ObjectRegistration<YangModuleInfo> inner) {
+ private ObjectRegistrationWrapper(final ObjectRegistration<YangModuleInfo> inner) {