Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Programmatically Activate/Deactivate the configuration of OSGI bundle

ashwiniv5325199
Level 2
Level 2

Hi,

      How to programmatically activate/deactivate(start/stop) the configuration of the osgi bundle(Not bundle start/stop)?

Please provide the example or syntax for this issue.

Thanks & Regards,

Ashwini

1 Reply
Arun_Patidar
Community Advisor
Community Advisor

Hi,

You can get the bundle using BundleContext and start stop using Bundle APIs.

https://osgi.org/javadoc/r4v43/core/org/osgi/framework/BundleContext.html

https://osgi.org/javadoc/r4v43/core/org/osgi/framework/Bundle.html  '

https://www.javatips.net/api/org.osgi.framework.frameworkutil

BundleContext bundleContext = FrameworkUtil.getBundle(MyClass.class).getBundleContext();