Skip to content
Snippets Groups Projects
Commit 62539a4d authored by Rob Adams's avatar Rob Adams
Browse files

Bootstrapping and upgrade now working with sync service

parent 8e2aba23
No related branches found
No related tags found
No related merge requests found
...@@ -405,8 +405,10 @@ public class FloodlightModuleLoader { ...@@ -405,8 +405,10 @@ 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
* @throws FloodlightModuleException
*/ */
protected void startupModules(Collection<IFloodlightModule> moduleSet) { protected void startupModules(Collection<IFloodlightModule> moduleSet)
throws FloodlightModuleException {
for (IFloodlightModule m : moduleSet) { for (IFloodlightModule m : moduleSet) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("Starting " + m.getClass().getCanonicalName()); logger.debug("Starting " + m.getClass().getCanonicalName());
......
...@@ -34,57 +34,59 @@ import java.util.Map; ...@@ -34,57 +34,59 @@ import java.util.Map;
* @author alexreimers * @author alexreimers
*/ */
public interface IFloodlightModule { public interface IFloodlightModule {
/** /**
* Return the list of interfaces that this module implements. * Return the list of interfaces that this module implements.
* All interfaces must inherit IFloodlightService * All interfaces must inherit IFloodlightService
* @return * @return
*/ */
public Collection<Class<? extends IFloodlightService>> getModuleServices(); public Collection<Class<? extends IFloodlightService>> getModuleServices();
/** /**
* Instantiate (as needed) and return objects that implement each * Instantiate (as needed) and return objects that implement each
* of the services exported by this module. The map returned maps * of the services exported by this module. The map returned maps
* the implemented service to the object. The object could be the * the implemented service to the object. The object could be the
* same object or different objects for different exported services. * same object or different objects for different exported services.
* @return The map from service interface class to service implementation * @return The map from service interface class to service implementation
*/ */
public Map<Class<? extends IFloodlightService>, public Map<Class<? extends IFloodlightService>,
IFloodlightService> getServiceImpls(); IFloodlightService> getServiceImpls();
/** /**
* Get a list of Modules that this module depends on. The module system * Get a list of Modules that this module depends on. The module system
* will ensure that each these dependencies is resolved before the * will ensure that each these dependencies is resolved before the
* subsequent calls to init(). * subsequent calls to init().
* @return The Collection of IFloodlightServices that this module depends * @return The Collection of IFloodlightServices that this module depends
* on. * on.
*/ */
public Collection<Class<? extends IFloodlightService>> getModuleDependencies(); public Collection<Class<? extends IFloodlightService>> getModuleDependencies();
/** /**
* This is a hook for each module to do its <em>internal</em> initialization, * This is a hook for each module to do its <em>internal</em> initialization,
* e.g., call setService(context.getService("Service")) * e.g., call setService(context.getService("Service"))
* *
* All module dependencies are resolved when this is called, but not every module * All module dependencies are resolved when this is called, but not every module
* is initialized. * is initialized.
* *
* @param context * @param context
* @throws FloodlightModuleException * @throws FloodlightModuleException
*/ */
void init(FloodlightModuleContext context) throws FloodlightModuleException; void init(FloodlightModuleContext context) throws FloodlightModuleException;
/** /**
* This is a hook for each module to do its <em>external</em> initializations, * This is a hook for each module to do its <em>external</em> initializations,
* e.g., register for callbacks or query for state in other modules * e.g., register for callbacks or query for state in other modules
* *
* It is expected that this function will not block and that modules that want * It is expected that this function will not block and that modules that want
* non-event driven CPU will spawn their own threads. * non-event driven CPU will spawn their own threads.
* *
* @param context * @param context
*/ * @throws FloodlightModuleException
*/
void startUp(FloodlightModuleContext context);
void startUp(FloodlightModuleContext context)
throws FloodlightModuleException;
} }
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