Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

0

Explanation for writing config.xml file

asked 2015-06-07 11:42:09 -0700

updated 2015-06-08 04:10:10 -0700

I referred the wiki : https://wiki.opendaylight.org/view/OpenDaylightController:MD-SAL:Archetype Tutorial for writing the sample application ( https://github.com/subh007/ODL-Sample-App ) and now I am able to invoke the exposed services from BindingAwareConsumer.

Now I am trying to receive the notifications but that require some modification in the config.xml file. But I am not able to understand the required modification in config.xml.

Could someone please help me to understand the structure of config.xml file and the following question :

  1. Why config file is required ? I think, same information can be retrieved from the yang and pom file.
  2. Could someone please explain me the details/ steps to add the notification service to config.xml and its working ?

Thanks !!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-06-08 07:37:40 -0700

updated 2015-06-08 07:41:09 -0700

Hello,

  1. The config file is used to deploy your modules into the karaf container. You can also specify which services to inject into the instance. I would suggest looking into: Initial Config and More Configs . You can see that we define 2 things: modules and required capabilities that refer to the modules. In the first link, the data broker is injected into the toaster-provider-impl so that it can be used in the code. In the second link, we can see that a RPC registration happens and it is injected into that same toaster-provider-impl.

  2. If you look into "Wire the KitchenServiceImpl for notifications" you will be able to find what you are looking for.

Think of config files like they are OSGi blueprint that replace the Activator and where you can inject classes into your karaf instance.

edit flag offensive delete publish link more

Comments

grmontpetit, How it is different or advantageous injecting the dependencies than getting them from a SAL registry?

vikram_darsi ( 2015-06-11 06:03:35 -0700 )edit
1

Hello, The reason for using the config pusher is that it takes into account the loading order of the dependencies (ie: asynchronous). If bundle B uses the dataBroker from bundle A but bundle A wasn't loaded first, then it will be null, where as the config pusher takes the loading order into account.

grmontpetit ( 2015-06-12 09:40:26 -0700 )edit

Thanks @grmontpetit for the clarification. I am trying to add `data-broker` service to my application but I am facing some issues related to `config-pusher`. Could you please help me for that https://ask.opendaylight.org/question/4019/error-unable-to-push-configuration-due-to-missing-yang-models/

subhash ( 2015-06-14 11:05:30 -0700 )edit

Resolving bundle B leads to resolution of bundle A(dependency specified in import package of the manifestation file of B). So, until the DataBroker is made available, the consumers of it will not be activated. specifying dependencies internally ensure the order of loading. correct me if wrong

vikram_darsi ( 2015-06-15 19:17:12 -0700 )edit

thanks @vikram_darsi for the suggestion.

subhash ( 2015-06-16 00:42:58 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-06-07 11:42:09 -0700

Seen: 245 times

Last updated: Jun 08 '15