|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.floodlightcontroller.core.module.FloodlightModuleLoader
public class FloodlightModuleLoader
Finds all Floodlight modules in the class path and loads/starts them.
| Field Summary | |
|---|---|
static java.lang.String |
COMPILED_CONF_FILE
|
static java.lang.String |
FLOODLIGHT_CONFD
|
static java.lang.String |
FLOODLIGHT_MODULES_KEY
|
protected FloodlightModuleContext |
floodlightModuleContext
|
protected static java.util.Set<java.lang.String> |
initedSet
|
protected static java.lang.Object |
lock
|
protected static org.slf4j.Logger |
logger
|
protected static java.util.Map<java.lang.String,IFloodlightModule> |
moduleNameMap
|
protected static java.util.Map<IFloodlightModule,java.util.Collection<java.lang.Class<? extends IFloodlightService>>> |
moduleServiceMap
|
protected static java.util.Map<java.lang.Class<? extends IFloodlightService>,java.util.Collection<IFloodlightModule>> |
serviceMap
|
protected static java.util.Set<java.lang.String> |
startedSet
|
| Constructor Summary | |
|---|---|
FloodlightModuleLoader()
|
|
| Method Summary | |
|---|---|
protected void |
addModule(java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightModule> moduleMap,
java.util.Collection<IFloodlightModule> moduleSet,
IFloodlightModule module)
Add a module to the set of modules to load and register its services |
protected static void |
findAllModules(java.util.Collection<java.lang.String> mList)
Finds all IFloodlightModule(s) in the classpath. |
protected void |
initModules(java.util.Collection<IFloodlightModule> moduleSet)
Allocate service implementations and then init all the modules |
IFloodlightModuleContext |
loadModulesFromConfig(java.lang.String fName)
Loads the modules from a specified configuration file. |
IFloodlightModuleContext |
loadModulesFromList(java.util.Collection<java.lang.String> configMods,
java.util.Properties prop)
Loads modules (and their dependencies) specified in the list. |
protected IFloodlightModuleContext |
loadModulesFromList(java.util.Collection<java.lang.String> configMods,
java.util.Properties prop,
java.util.Collection<IFloodlightService> ignoreList)
Loads modules (and their dependencies) specified in the list |
protected void |
parseConfigParameters(java.util.Properties prop)
Parses configuration parameters for each module |
protected void |
startupModules(java.util.Collection<IFloodlightModule> moduleSet)
Call each loaded module's startup method |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.slf4j.Logger logger
protected static java.util.Map<java.lang.Class<? extends IFloodlightService>,java.util.Collection<IFloodlightModule>> serviceMap
protected static java.util.Map<IFloodlightModule,java.util.Collection<java.lang.Class<? extends IFloodlightService>>> moduleServiceMap
protected static java.util.Map<java.lang.String,IFloodlightModule> moduleNameMap
protected static java.lang.Object lock
protected static java.util.Set<java.lang.String> initedSet
protected static java.util.Set<java.lang.String> startedSet
protected FloodlightModuleContext floodlightModuleContext
public static final java.lang.String COMPILED_CONF_FILE
public static final java.lang.String FLOODLIGHT_MODULES_KEY
public static final java.lang.String FLOODLIGHT_CONFD
| Constructor Detail |
|---|
public FloodlightModuleLoader()
| Method Detail |
|---|
protected static void findAllModules(java.util.Collection<java.lang.String> mList)
throws FloodlightModuleException
FloodlightModuleException - If two modules are specified in the configuration
that provide the same service.
public IFloodlightModuleContext loadModulesFromConfig(java.lang.String fName)
throws FloodlightModuleException
fName - The configuration file path
FloodlightModuleException
protected IFloodlightModuleContext loadModulesFromList(java.util.Collection<java.lang.String> configMods,
java.util.Properties prop,
java.util.Collection<IFloodlightService> ignoreList)
throws FloodlightModuleException
mList - The array of fully qualified module namesignoreList - The list of Floodlight services NOT to
load modules for. Used for unit testing.
FloodlightModuleException
public IFloodlightModuleContext loadModulesFromList(java.util.Collection<java.lang.String> configMods,
java.util.Properties prop)
throws FloodlightModuleException
IModuleService
loadModulesFromList in interface IModuleServiceconfigMods - The collection of fully qualified module names to load.prop - The list of properties that are configuration options.
FloodlightModuleException
protected void addModule(java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightModule> moduleMap,
java.util.Collection<IFloodlightModule> moduleSet,
IFloodlightModule module)
moduleMap - the module mapmoduleSet - the module setmodule - the module to add
protected void initModules(java.util.Collection<IFloodlightModule> moduleSet)
throws FloodlightModuleException
moduleSet - The set of modules to call their init function on
FloodlightModuleException - If a module can not properly be loaded
protected void startupModules(java.util.Collection<IFloodlightModule> moduleSet)
throws FloodlightModuleException
moduleSet - the module set to start up
FloodlightModuleExceptionprotected void parseConfigParameters(java.util.Properties prop)
prop - The properties file to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||