I am trying to run OSGi framework (Equinox) in a main method.
Each time I start the framework, when I print BundleContext.getBundles().length, it says the framework has only 1 Bundle installed on (that is certainly the system bundle).
When I install my first bundle the bundle ID will continue from the last session. let’s say if I had 4 bundles last session (and I have stopped and uninstalled all of them before stopping the system bundle), the first Bundle ID is set 5.
Now, I want to know how does the framework choose the bundle ID? Why and how does the framework remembers the last session, even though I had uninstalled all of the bundles? Is it because of Bundle Cache? And if it is, how can I clear the cache (to restart numbering from 1)?
I am trying to run OSGi framework (Equinox) in a main method. Each time
Share
The framework has the last used bundle id somewhere in the persistent store it manages. What this store looks like is a framework implementation detail. When you launch the framework, you can specify the
org.osgi.framework.storage.cleanframework configuration property. This will clear all installed bundles but I am not sure if it will reset the last used bundle id.