net.floodlightcontroller.core.module
Interface IFloodlightModule

All Known Implementing Classes:
AbstractStorageSource, AbstractSyncManager, ApplicationLoader, CounterStore, DebugCounter, DebugEvent, DefaultEntityClassifier, DeviceManagerImpl, Firewall, FloodlightProvider, FlowReconcileManager, Forwarding, Hub, JythonDebugInterface, LearningSwitch, LinkDiscoveryManager, LoadBalancer, MemoryStorageSource, NoSqlStorageSource, NullCounterStore, NullDebugCounter, NullDebugEvent, NullPktInProcessingTime, OFMessageFilterManager, PktInProcessingTime, PortDownReconciliation, RemoteSyncManager, RestApiServer, StaticFlowEntryPusher, StaticWebRoutable, SyncManager, SyncTorture, ThreadPool, TopologyManager, VirtualNetworkFilter

public interface IFloodlightModule

Defines an interface for loadable Floodlight modules. At a high level, these functions are called in the following order:

  1. getServices() : what services does this module provide
  2. getDependencies() : list the dependencies
  3. init() : internal initializations (don't touch other modules)
  4. startUp() : external initializations (do touch other modules)

Author:
alexreimers

Method Summary
 java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
          Get a list of Modules that this module depends on.
 java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
          Return the list of interfaces that this module implements.
 java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
          Instantiate (as needed) and return objects that implement each of the services exported by this module.
 void init(FloodlightModuleContext context)
          This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized.
 void startUp(FloodlightModuleContext context)
          This is a hook for each module to do its external initializations, 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 non-event driven CPU will spawn their own threads.
 

Method Detail

getModuleServices

java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
Return the list of interfaces that this module implements. All interfaces must inherit IFloodlightService

Returns:

getServiceImpls

java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
Instantiate (as needed) and return objects that implement each of the services exported by this module. The map returned maps the implemented service to the object. The object could be the same object or different objects for different exported services.

Returns:
The map from service interface class to service implementation

getModuleDependencies

java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
Get a list of Modules that this module depends on. The module system will ensure that each these dependencies is resolved before the subsequent calls to init().

Returns:
The Collection of IFloodlightServices that this module depends on.

init

void init(FloodlightModuleContext context)
          throws FloodlightModuleException
This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized.

Parameters:
context -
Throws:
FloodlightModuleException

startUp

void startUp(FloodlightModuleContext context)
             throws FloodlightModuleException
This is a hook for each module to do its external initializations, 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 non-event driven CPU will spawn their own threads.

Parameters:
context -
Throws:
FloodlightModuleException