[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] ServiceListener ignored after Service Replacement
- From: "Stuart McCulloch" <stuart.mcculloch@xxxxxxxxxx>
- Date: Fri, 13 Apr 2007 12:17:58 +0800
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Vs1WwssULNdRsGLVNvxCmb1WagBXsuTGvxrL17yrQ8MedBb2qrfZr4kV2JjaqHBFmETOGSP4Zmw/HcOUr9+lCuCpPrcaffEzuOcepN24xykTvvCm+9xprb4Ok6mL7cJ5g4/A+PJmbHMO0YoxvojPn22A4lAd0K1LDoZkGrj933o=
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),
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!