Skip to content
Snippets Groups Projects
Commit c2a01eb5 authored by Colin Dixon's avatar Colin Dixon
Browse files

allowing modules to transparently inherit configuration parameters from their superclasses

parent e0566f44
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,19 @@ public class FloodlightModuleContext implements IFloodlightModuleContext {
retMap = new HashMap<String, String>();
configParams.put(module.getClass(), retMap);
}
// also add any configuration parameters for superclasses, but
// only if more specific configuration does not override it
for (Class<? extends IFloodlightModule> c : configParams.keySet()) {
if (c.isInstance(module)) {
for (Map.Entry<String, String> ent : configParams.get(c).entrySet()) {
if (!retMap.containsKey(ent.getKey())) {
retMap.put(ent.getKey(), ent.getValue());
}
}
}
}
return retMap;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment