Not every OpenDaylight project is available in Since we are not dependent on the OSGi framework (Karaf), we can’t simply add and start project features from the Karaf command line.

Here is a list of all OpenDaylight Projects. Before starting the integration, make sure that your project is not already integrated within

Here is the list of already integrated modules. In this article, we will use the OpenFlow project as an example of how to integrate the new project to

We have already integrated the OpenFlow project into – it is available under lighty-modules/lighty-openflow-sb.

Create a new project

Create a new Java project for your module. In this example, we will be using Maven.

Create a new module

Create a new Java class, which will represent new module. In our example, we will create the class OpenflowSouthboundPlugin , which corresponds with the OpenFlow module. provides an abstract AbstractLightyModule class, containing methods to start and shut down a module. By extending the AbstractLightyModule, you only need to implement two abstract methods:

  • initProcedure 
  • stopProcedure 

to initialize/stop services & beans in your module. Additionall,y we recommend to use Builder pattern to create instances of your new module, in case your module requires a larger amount of input parameters.

Initialize Beans & Services

This section will give you hints on how to find all beans and services from the original project, that you may need to start in your new module.

Clone OpenDaylight Project

Clone the project from opendaylight-gerrit repository. Check out the version you would like to integrate.

Find all necessary Blueprint files

Check all project features for blueprint files. Usually, you’re looking for the autowire.xml file, which is located in the project:


This file is generated during the build from the annotations and blueprint .xml files. In the project are blueprint files usually located in:


Here is the example of the interfacemanager-impl feature autowire.xml file from the genius module project.

<?xml version="1.0" encoding="UTF-8"?><blueprint xmlns="">
    <bean id="alivenessMonitorListenerImpl" class="org.opendaylight.genius.interfacemanager.listeners.AlivenessMonitorListenerImpl" init method="start" destroy-method="close">
        <argument ref="dataBroker"/>
        <argument ref="notificationService"/>
	<bean id="ifmDiagStatusProvider" class="org.opendaylight.genius.interfacemanager.diagstatus.IfmDiagStatusProvider" destroy-method="close">
        <argument ref="diagStatusService"/>
	<bean id="interfacemgrProvider" class="org.opendaylight.genius.interfacemanager.InterfacemgrProvider" destroy-method="close">
        <argument ref="dataBroker"/>
        <argument ref="entityOwnershipService"/>
        <argument ref="idManagerService"/>
        <argument ref="interfaceManagerRpcService"/>
        <argument ref="jobCoordinator"/>
        <argument ref="interfaceManagerCommonUtils"/>
        <argument ref="interfaceMetaUtils"/>
        <argument ref="ifmConfig"/>
        <argument ref="ifmDiagStatusProvider"/>
	<service ref="ifmDiagStatusProvider" interface="org.opendaylight.infrautils.diagstatus.ServiceStatusProvider"/

As you can see, it contains 3 beans, where IfmDiagStatusProvider is a service. We need to create them within our module project. Bean AlivenessMonitorListenerImpl has init and destroy methods, which we need to call as well – usually in the initProcedure and stopProcedure methods. 

Sometimes, beans require classes from other projects. Always check beforehand, if the required class isn’t already being created in one of the present modules. If it’s there, don’t create it in your module – just pass it to the module as a dependency. Some beans are also created by the builder pattern, which needs to set up class attributes to specific values. Check if the project has a resource file under src/main/resources/initial/config-file.xml, which contains the default values.

Create Beans & initProcedure

In the initProcedure, we are going to initialize all necessary classes, which are in the blueprints. Here is a snippet of the OpenFlow plugin method:

protected boolean initProcedure() {
    ForwardingPingPongDataBroker forwardingPingPongDataBroker =
          new ForwardingPingPongDataBroker(lightyServices.getBindingDataBroker());
    SwitchConnectionProviderList switchConnectionProviders = new SwitchConnectionProviderList(providers);
	this.mastershipChangeServiceManager = new MastershipChangeServiceManagerImpl();
    final OpenflowDiagStatusProvider diagStat = new OpenflowDiagStatusProviderImpl(this.lightyServices
    this.openFlowPluginProvider = new OpenFlowPluginProviderImpl(
          this.mastershipChangeServiceManager, diagStat,

We are creating 2 classes from the OpenFlow blueprints directly in the initProcedure. The OpenFlowPluginProviderImpl class requires some dependencies, which are provided by lightyServices – located in the lighty controller module. We are also calling the initialize method on the bean as well.

Close Beans in the stopProcedure

In stopProcedure, we are going to call the destroy-methods on all beans, which have it described in the blueprints.

protected boolean stopProcedure() {
    return true;

Runnable application with the new module

A application is basically just a plain old Java main method, that will run your module and all necessary dependencies. In order to create an application for your module, simply create and start all the necessary dependencies in the main method first, and then create and start your module.

We are now going to show you, how we have made the example OpenFlow application. First step is to get the configuration of the modules:

final Set<YangModuleInfo> modelPaths = Stream.concat(,
controllerConfiguration = ControllerConfigUtils.getDefaultSingleNodeConfiguration(modelPaths);
restConfConfiguration =  RestConfConfigUtils.getDefaultRestConfConfiguration();
openflowpluginConfiguration = OpenflowConfigUtils.getDefaultOfpConfiguration();

After we have the required configuration, we can start the modules one after the other.

//1. initialize and start Lighty controller (MD-SAL, Controller, YangTools, Akka)
final LightyControllerBuilder lightyControllerBuilder = new LightyControllerBuilder();
final LightyController lightyController = lightyControllerBuilder.from(controllerConfiguration).build();
//2. start RESTCONF server
final CommunityRestConfBuilder communityRestConfBuilder = new CommunityRestConfBuilder();
final CommunityRestConf communityRestConf = communityRestConfBuilder.from(RestConfConfigUtils
	.getRestConfConfiguration(restConfConfiguration, lightyController.getServices()))
//3. start OpenFlow SBP
final OpenflowSouthboundPlugin plugin;
plugin = new OpenflowSouthboundPluginBuilder()
	.from(configuration, lightyController.getServices())
	.withPacketListener(new PacketInListener())
ListenableFuture<Boolean> start = plugin.start();

Check out the example applications in or other articles, for more information.


In this article, we have described the way to include other OpenDaylight projects, which are not integrated into our Steps of integrating the new module were:

  • Creating new project for the module
  • Initializing module classes from blueprints
  • Creating the runnable application in which a new module started

Don’t forget, some classes require dependencies from another module and its recommended to use existing implementations if they are available in

by Peter Válka

Categories: lighty.ioPost