闫伯元
闫伯元

Reputation: 465

How can I get current bundle's BundleContext instance while using declarative services in karaf 3.0.2

In ONOS on karaf 3.0.2, I wish to get current bundle's BundleContext instance for tracking bundle's status and configuring it. But ONOS uses declarative service, so I cannot use function like BundleContext.getServiceReference() to get it. Could anyone help me ?

Upvotes: 1

Views: 477

Answers (1)

Christian Schneider
Christian Schneider

Reputation: 19626

You can inject the BundleContext in an @Activate method when using DS.

Upvotes: 6

Related Questions