Hi all,
I was wondering if it is possible to prevent a specific cached bundle from starting when Felix starts? We have started using OSGi and Felix in our existing product a while ago but still are coming to grips with it. One thing that we had some trouble with (and had implemented badly) is the use of the Felix bundle cache. We initially always cleared the bundle cache before starting Felix and then had Felix install some system bundles by setting the property "felix.auto.start.1" to a list of bundles to be started. We then did some application specific startup logic and only when that was done would we install the Felix File Install bundle 'manually' with a call to BundleContext#installBundle. Unfortunately this degraded our startup performance. An OSGi expert pointed out to us that this is not very efficient and that the bundle cache is meant to (be able to) survive between shutdown and startup, so we are now refactoring our code to use this feature. It is here that we run into the problem. Basically startup of our server consists of two phases: INITIALIZE mode and NORMAL mode. During initialize mode the system bundles should be installed and started and any 'user' bundles that were already installed and running before the server was stopped should resume. Then, when we enter NORMAL mode, the File Install bundle should be installed and started and monitor the bundle deploy folder for new, changed or removed user bundles. However, when we start Felix with the File Install bundle in the cache, that starts right away and immediately begins installing 'user' bundles when we are still in INITIALIZE mode, causing havoc. So what I want is, just before calling Felix.start, remove the File Install bundle from the cache so we can install it manually after we entered the NORMAL mode. Is that possible? Or even the right way to go about it? Or is there some smarter approach we could take? Any advice would be greatly appreciated. Thanks for a great open source project! -Stijn

