I have an equinox runtime, where I have deployed my bundles. I notice that at times, when I do not do a clean start, as in start without osgi.clean option, I notice that some of my bundles go into Stopped state. This happens when a "Refresh packages" thread spawned by the framework is run. It seems to be stopping my application bundles.
My setup is such that I am using my own custom module loader, which loads my bundles from a pre-specified folder and after my bundles are installed / updated, I also directly invoke PackageAdmin.refreshPackages and it seems to be returning correctly and all bundles are in a proper state, but then this thread gets spawned and it seems to stop most of my application bundles. Not sure what the problem is, so I did a dump of my stack Trace in my Activator stop and I could see this
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.Thread.run(Unknown Source)
Wanted to know when this would happen / how it can be rectified. Also wanted to know, whether it is possible to stop the Refresh packages thread from being spawned through some configuration, because I am anyway invoking it directly in my application and therefore don't need the framework to do it. Any help regarding this would be much appreciated.