Skip to content
Snippets Groups Projects
Commit c1e0d932 authored by Alex Reimers's avatar Alex Reimers Committed by Alex Reimers
Browse files

Lazy load configuration parameter maps for modules.

parent 34ccf1bd
No related branches found
No related tags found
No related merge requests found
......@@ -82,17 +82,10 @@ public class FloodlightModuleContext implements IFloodlightModuleContext {
*/
public void addConfigParam(IFloodlightModule mod, String key, String value) {
Map<String, String> moduleParams = configParams.get(mod.getClass());
moduleParams.put(key, value);
}
/**
* We initialize empty configuration maps for each module to be loaded.
* This way each module doens't have to null check their map.
*/
public void createConfigMaps() {
for (IFloodlightModule mod : moduleSet) {
Map<String, String> moduleParams = new HashMap<String, String>();
if (moduleParams == null) {
moduleParams = new HashMap<String, String>();
configParams.put(mod.getClass(), moduleParams);
}
moduleParams.put(key, value);
}
}
......@@ -214,7 +214,6 @@ public class FloodlightModuleLoader {
}
floodlightModuleContext.setModuleSet(moduleSet);
floodlightModuleContext.createConfigMaps();
parseConfigParameters(prop);
initModules(moduleSet);
startupModules(moduleSet);
......
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