import org.apache.felix.dm.Component;
import org.opendaylight.controller.clustering.services.IClusterContainerServices;
+import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
import org.opendaylight.controller.sal.inventory.IInventoryService;
import org.opendaylight.controller.sal.inventory.IListenInventoryUpdates;
protected static final Logger logger = LoggerFactory
.getLogger(Activator.class);
- /**
- * Function called when the activator starts just after some
- * initializations are done by the
- * ComponentActivatorAbstractBase.
- *
- */
- @Override
- public void init() {
-
- }
-
- /**
- * Function called when the activator stops just before the
- * cleanup done by ComponentActivatorAbstractBase
- *
- */
- @Override
- public void destroy() {
-
- }
/**
* Function that is used to communicate to dependency manager the
IClusterContainerServices.class).setCallbacks(
"setClusterContainerService",
"unsetClusterContainerService").setRequired(true));
+ c.add(createContainerServiceDependency(containerName).setService(
+ IConfigurationContainerService.class).setCallbacks(
+ "setConfigurationContainerService",
+ "unsetConfigurationContainerService").setRequired(true));
+ c.add(createServiceDependency()
+ .setService(IControllerProperties.class)
+ .setCallbacks("setControllerProperties", "unsetControllerProperties")
+ .setRequired(true));
}
}
+ /**
+ * {@inheritDoc}
+ */
@Override
protected Object[] getGlobalImplementations() {
- final Object[] res = { SwitchManagerCLI.class };
+ final Object[] res = { ControllerProperties.class, SwitchManagerCLI.class };
return res;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void configureGlobalInstance(Component c, Object imp) {
+ if (imp.equals(ControllerProperties.class)) {
+ c.setInterface(new String[] { IControllerProperties.class.getName() }, null);
+
+ c.add(createServiceDependency()
+ .setService(IClusterGlobalServices.class)
+ .setCallbacks("setClusterService", "unsetClusterService")
+ .setRequired(true));
+ }
+ }
}