We have a similar requirement which I¹m sad to say is being worked around with wait code. We can¹t know the list of bundles/features which will be deployed and required ahead of time. Our ETL application runs transformations after startup which may contain steps provided by plugins (deployed as bundles). When can the application be certain that the Karaf environment is fully initialized, all features have been installed and FileInstall has done a pass over the configured directories? Today if the step component isn¹t available we loop/wait for a configurable timeout then fail if it hasn¹t become available.
-Nick On 12/10/14, 2:50 PM, "Jean-Baptiste Onofré" <[email protected]> wrote: >You can implement a BundleListener to catch when the bundle is >installed/started and do some code. > >Regards >JB > >On 12/10/2014 08:20 PM, thully wrote: >> Our project (Cytoscape) utilizes Karaf for OSGi bundle loading and >> management. We are using Felix FileInstall to load additional bundles >> ("apps") installed by users. As it stands, the bundles loaded by Felix >> FileInstall load after all other bundles. While this is generally what >>we >> want, we do have some code that we'd like to trigger after the bundles >> loaded by FileInstall have started - or at least after an attempt has >>been >> made to start them. >> >> Is there a way to do this? It doesn't seem like Felix FileInstall has >>much >> of an API to speak of, though it seems this may be possible by using >>Karaf >> runlevels - particularly with the ability to respect load order on >>3.0.2. >> If not, it seems like we may need to move away from Felix FileInstall >>and >> write our own bundle installation mechanism... >> >> >> >> -- >> View this message in context: >>http://karaf.922171.n3.nabble.com/How-to-execute-code-after-bundles-start >>ed-by-Felix-FileInstall-tp4037120.html >> Sent from the Karaf - User mailing list archive at Nabble.com. >> > >-- >Jean-Baptiste Onofré >[email protected] >http://blog.nanthrax.net >Talend - http://www.talend.com
