How to stop a bundle in Apache Felix Webconsole using code
So I have these bundles installed and can be accessed through the gui from http://localhost/path/to/bundles. Here resides the UI where one can search through the bundles and manually shut it down. I want to be able to do that in code.
I am currently looking through the org.apache.felix.webconsole-3.1.8.jar for examples. So I guess my question is:
- 开发者_如何学Python
How do I connect to the webconsole so that I can retrieve the list of bundles
How can I look for the specific bundle? By symbolicName?
Assuming that your code is running in the same OSGi container, there's no reason to use the webconsole for this. You can just use something like Spring-DM or Blueprint to get a reference to BundleContext and then use the getBundle methods to get a reference the bundle that you want to stop.
From there, you can call Bundle.stop().
精彩评论