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 ?
Asked
Active
Viewed 467 times
1

闫伯元
- 445
- 1
- 4
- 9
1 Answers
6
You can inject the BundleContext in an @Activate method when using DS.

Christian Schneider
- 19,420
- 2
- 39
- 64
-
Do you mean something like this : @Activate public void activate(BundleContext context); – 闫伯元 Sep 20 '16 at 14:07