>From what I understand BundleActivator warns when un bundle is 
>started/stopped, which is not exactly the usecase I would like.

The .so lib must be loaded once. The best thing would be to obtain an event 
stating the bundle is installed so I may load the lib.

For the moment I added a class with a static part. I load the lib when that 
class is loaded by the classloader, which is not very good but does the job. I 
also put the bundle as singleton for extra protection.

JP

[@@ OPEN @@]

-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:[email protected]] 
Envoyé : jeudi 27 juin 2013 16:15
À : [email protected]
Objet : Re: How to call a code only once

Hi JP,

you can control the loading in the BundleActivator.

Regards
JB

On 06/27/2013 10:45 AM, CLEMENT Jean-Philippe wrote:
> Dear Karaf,
>
> I have a bundle which loads .so libraries. I would like this code to run 
> once. What is the easiest way to do so?
>
> Best regards,
> JP
>

-- 
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to