I'm starting to use OSGi and I'm a little "noob" in the bussiness.
My problem is the next;
I have a bundle that I need to be singleton, because it must be accessed by another two bundles at the same time; I mean, two different bundles are going to use it, and when one of them modifies some of the values inside the first bundle, the change must be seen by the second bundle.
I'm working with Eclipse and in the manifest.mf file there's an option to make the bundle singleton, but I don't know if that's working.
I explain: To probe if the bundle is singleton, I used the option in the manifest.mf file to make "plug-in as singleton". Then, I inserted a new property inside the first bundle(the one that must be singleton). The property is just an String, message, who's default value is "Not altered".I also implemented two function, setMessage(String) and getMessage.
Well, with the second bundle I modify the value to "Altered by bundle2". But when I read the value with bundle3, the message value is ALWAYS "Not altered" , UNLESS I set Message as STATIC.
My doubt is the next; When I put Message as static, it always works. I modify the value and when I read it , it writes "Altered by bundle2", perfect. But that works always, even If I don't choose the "this plug-in as singleton" option in the manifest.mf file. It seems that it doesn't care if I mark it as singleton if I just put static in the property.
But this way I don't know if it's really a singleton or what. It doesn't make sense to me... does this mean that if I want the actualized values of the properties I need to mark them as static, and nothing else?
I attach an Image because my english is soooo poor and I don't know if I explain correctly what I want to do.
Thanks a lot for your time dudes,