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

Revision history [back]

Hello @ahuja,

What ODL version do you want to use? If using Boron or master, I strongly recommend not using the config system to inject dependencies, as you're doing in the code shown. Instead you should use blueprint, which is way easier.

To register a notification listener using blueprint, see this wiki

Here is a concrete example with blueprint: 1. Create the bean (that will instantiate your class implementing the *Listener interface) 2. Register the listener using odl:notification-listener

If you really need to be tied to Beryllium or previous version, I'll edit that response with appropriate information.

Hope this helps. Alexis

Hello @ahuja,

What ODL version do you want to use? If using Boron or master, I strongly recommend not using the config system to inject dependencies, as you're doing in the code shown. Instead you should use blueprint, which is way easier.

Beryllium and previous:

  1. You need to add the NotificationService in the default-config.xml file to inject its instance in the *Module#createInstance() See this example - pretty much the same as your, but using the new interface, not the deprecated one.
  2. In the *Module#createInstance() get the NotificationService dependency See this example - You've done the same thing already
  3. In the provider, use the #registerNotificationListener() from the NotificationService.
  4. Hold the Registration element to close it in the #close() funtion

Boron and after:

To register a notification listener using blueprint, see this wiki

Here is a concrete example with blueprint: 1. Create the bean (that will instantiate your class implementing the *Listener interface) 2. Register the listener using odl:notification-listener

If you really need to be tied to Beryllium or previous version, I'll edit that response with appropriate information.

Hope this helps. Alexis