[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] ServiceListener ignored after Service Replacement

On 13/04/07, Thomas Fischer <fischer@xxxxxxxxxxxxxxxxxxx> wrote:
I have some fields in the old Bundle B, which I want to copy to the new Bundle B* controlled via a Bundle D. But if I assume it the right way, there is no possible way to pass an object instantiated in B containing the fields to B* via D, because B* could not resolve the type of the Object being instantiated in the Classloader of B and therefore not visible for B*. (I get a ClassCast Exception again)

You could do this if you add some sort of 'settings' class in bundle C, then B can provide an instance of this class to D which can temporarily store, either in memory or persistent storage, and B* can consume it - but you must do a deep copy of the data, not store the refs, otherwise B won't be GC'd.

Otherwise perhaps use the ConfigurationAdmin service to pass the config?

Regards from Erlangen (Germany),
Thomas Fischer

PS: Again sorry for bothering you again, but I am writing my Master Thesis about OSGi as a dynamic component/service framework and these issues are the last open questions I have, which no one was able to answer, yet.

No problem, everyone benefits from these discussions. Hope the thesis goes well!

Cheers, Stuart