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

Change how modules are inited/started to be more deterministic.

parent 670806e9
No related branches found
No related tags found
No related merge requests found
...@@ -172,7 +172,7 @@ public class FloodlightModuleLoader { ...@@ -172,7 +172,7 @@ public class FloodlightModuleLoader {
logger.debug("Starting module loader"); logger.debug("Starting module loader");
findAllModules(configMods); findAllModules(configMods);
Set<IFloodlightModule> moduleSet = new HashSet<IFloodlightModule>(); Collection<IFloodlightModule> moduleSet = new ArrayList<IFloodlightModule>();
Map<Class<? extends IFloodlightService>, IFloodlightModule> moduleMap = Map<Class<? extends IFloodlightService>, IFloodlightModule> moduleMap =
new HashMap<Class<? extends IFloodlightService>, new HashMap<Class<? extends IFloodlightService>,
IFloodlightModule>(); IFloodlightModule>();
...@@ -253,7 +253,7 @@ public class FloodlightModuleLoader { ...@@ -253,7 +253,7 @@ public class FloodlightModuleLoader {
*/ */
protected void addModule(Map<Class<? extends IFloodlightService>, protected void addModule(Map<Class<? extends IFloodlightService>,
IFloodlightModule> moduleMap, IFloodlightModule> moduleMap,
Set<IFloodlightModule> moduleSet, Collection<IFloodlightModule> moduleSet,
IFloodlightModule module) { IFloodlightModule module) {
if (!moduleSet.contains(module)) { if (!moduleSet.contains(module)) {
Collection<Class<? extends IFloodlightService>> servs = Collection<Class<? extends IFloodlightService>> servs =
...@@ -267,11 +267,11 @@ public class FloodlightModuleLoader { ...@@ -267,11 +267,11 @@ public class FloodlightModuleLoader {
} }
/** /**
* Allocate service implementations and then init all the modules * Allocate service implementations and then init all the modules
* @param moduleSet The set of modules to call their init function on * @param moduleSet The set of modules to call their init function on
* @throws FloodlightModuleException If a module can not properly be loaded * @throws FloodlightModuleException If a module can not properly be loaded
*/ */
protected void initModules(Set<IFloodlightModule> moduleSet) protected void initModules(Collection<IFloodlightModule> moduleSet)
throws FloodlightModuleException { throws FloodlightModuleException {
for (IFloodlightModule module : moduleSet) { for (IFloodlightModule module : moduleSet) {
// Get the module's service instance(s) // Get the module's service instance(s)
...@@ -307,7 +307,7 @@ public class FloodlightModuleLoader { ...@@ -307,7 +307,7 @@ public class FloodlightModuleLoader {
* Call each loaded module's startup method * Call each loaded module's startup method
* @param moduleSet the module set to start up * @param moduleSet the module set to start up
*/ */
protected void startupModules(Set<IFloodlightModule> moduleSet) { protected void startupModules(Collection<IFloodlightModule> moduleSet) {
for (IFloodlightModule m : moduleSet) { for (IFloodlightModule m : moduleSet) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("Starting " + logger.debug("Starting " +
......
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