The PACKAGES_REFRESHED event it not intended to tell you which bundles were refreshed. The source is always the system bundle. Technically, refreshing after an update or uninstall is not required spec behavior (it is impl dependent) and can only happen if no other bundle will be impacted. Further, it is not clear if a refresh event should even be sent in the auto-refresh case at all...I know Felix does, but I don't think Equinox does...

-> richard

On 8/8/11 10:54 AM, Gjøran Voldengen wrote:
I am referring to framework version 3.2.2

When I receive a PACKAGES_REFRESHED event, it would be very convenient to
separate between the events that stem from individual bundles being
uninstalled or updated, and the event that is returned after calling
PackageAdmin.refreshPackages().

However, this is not possible, as event.getBundle() always returns the Felix
object itself:

Felix.uninstallBundle(BundleImpl)

- calls refreshPackages(new BundleImpl[] { bundle })
   (Felix line: 2461, the correct bundle is passed in an array)

- calls fireFrameworkEvent(FrameworkEvent.PACKAGES_REFRESHED, this, null);
   (Felix line: 3732, the second argument should have been the bundle, but
instead is the Felix object itself)

One solution could be to create a new method refreshPackages(BundleImpl),
that takes a single bundle as arg, so that the correct bundle can be passed
to fireFrameworkEvent() from Felix.uninstallBundle/updateBundle.

Regards,
Gjoran Voldengen


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to