________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Felix Meschberger
Sent: 11 June 2007 13:48
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Semantics of the refresh operation & uninstall
andwires
Hi,
1. I install the daemon bundle.
2. I submit a system description to be deployed, that involves
installing a new bundle from a given URL.
3. The new bundle is installed, and user component classes are
loaded from it. Because of the DynamicImport-Package directive, a wire
is created from the daemon bundle to the user bundle.
4. I now ask for the system description to be undeployed, and as
a result the user bundle is uninstalled.
5. I update the daemon bundle. The wire to the uninstalled user
bundle still exists.
6. I ask for the same system description to be deployed. It
fails with a ClassCastException.
However, if I refresh the packages between 5 and 6, things work
fine.
Any idea about what I'm doing wrongly ?
Actually, the daemon bundle needs no update, as there is now new
version, right ? You just want to unwire it from the uninstalled bundle.
So the correct way is to not update the daemon bundle but to refresh the
packages.
I'm assuming that there really is a new version here, as I'd like that
scenario to work. Sorry if that wasn't clear.
BTW: Are you required to have the daemon bundle load the client classes
? How about using Declarative Services ? Then you do not have a wire at
all and may even drop the DynamicImport-Package.
I've read about this a bit. This is where I want to go, but it will
require a pretty big design change, so I'd like the thing to work using
DynamicImport-Package for now.
But could you tell me a bit more about how that should be done ? I
suppose the user bundles would need to export a ServiceFactory, and the
daemon would then need to track these in Whiteboard fashion.
Cheers,
Olivier
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev