Programmatically Activate/Deactivate the configuration of OSGI bundle

Avatar

Avatar

ashwiniv5325199

Avatar

ashwiniv5325199

ashwiniv5325199

14-11-2018

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

999

Correct Answer

829
Arun_Patidar
MVP

14-11-2018

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();