Sfmar
Sfmar

Reputation: 159

Does Blueprint replace Activator class when implementing a OSGi bundle?

I'm new to Opendaylight and I'm currently trying to develop an app to get packet-in, analyse them and then dispatch them to other app. Does the blueprint replace the need for creating an Activator class to register the component with the OSGi framework? Or do we still need the activator to instantiate and set the dependencies? As far as I can tell, the blueprint already does that, am I correct?

Any help would be extremely appreciated!

Upvotes: 1

Views: 335

Answers (1)

Stephen Kitt
Stephen Kitt

Reputation: 2881

Yes, Blueprint takes care of the OSGi registration and discovery for you, as long as you declare the appropriate elements in the Blueprint descriptor: <reference/> to find a service, <service/> to expose one. The Using Blueprint page on the ODL wiki covers Blueprint usage in some detail, including OSGi integration and MD-SAL integration.

In many cases, if you’re using the ODL parent POMs you can take advantage of Blueprint autowiring, using @Singleton and @Inject annotations instead of writing an XML file.

(You can ignore all the Config Sub-System sections, that’s deprecated.)

Upvotes: 1

Related Questions