Adding reference to DefaultDriverProviderService in Corsa drivers to enforce correct ordering of driver loading at ONOS startup
Change-Id: I4c46faf5682a02c667ff81ab5edff0dd539e7d1b
diff --git a/drivers/corsa/src/main/java/org/onosproject/drivers/corsa/CorsaDriversLoader.java b/drivers/corsa/src/main/java/org/onosproject/drivers/corsa/CorsaDriversLoader.java
index b2ad9ee..33eb06e 100644
--- a/drivers/corsa/src/main/java/org/onosproject/drivers/corsa/CorsaDriversLoader.java
+++ b/drivers/corsa/src/main/java/org/onosproject/drivers/corsa/CorsaDriversLoader.java
@@ -17,13 +17,23 @@
package org.onosproject.drivers.corsa;
import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onosproject.net.driver.AbstractDriverLoader;
+import org.onosproject.net.driver.DefaultDriverProviderService;
/**
* Loader for Corsa device drivers.
*/
@Component(immediate = true)
public class CorsaDriversLoader extends AbstractDriverLoader {
+
+ //This reference is needed to enforce loading of the default drivers before
+ //the corsa drivers at ONOS startup if corsa.drivers is specified
+ //in the ONOS_APPS variable.
+ @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ private DefaultDriverProviderService defaultDriverProviderService;
+
public CorsaDriversLoader() {
super("/corsa-drivers.xml");
}