On 20 sep. 2013, at 04:56, Tim Diekmann wrote:
> On a side note, it is very annoying that a bundle that is installed and
> started may be added in ACTIVE state with STARTED BundleEvent, thereby
> missing all interim states and events. However, when you stop and restart the
> bundle, you will see the interim events. This makes the code ugly as you have
> to repeat the processing to account for either scenario.
Since you can start after another bundle it seems theoretically impossible to
get those earlier events unless you maintain history? Which is obviously
expensive and impossible in the long run.
A, use a bundle listener if you want to process the events. B a rather simple
state machine would allow you to add the missing events in your code. You are
outside the intended scope for Bundle Tracker (mainly extenders), so having
some code to process the different state entry points sounds expected?
Kind regards,
Peter Kriens
>
> Tim.
>
>
> From: BJ Hargrave <[email protected]>
> Reply-To: OSGi Developer Mail List <[email protected]>
> Date: Thursday, September 19, 2013 7:50 PM
> To: OSGi Developer Mail List <[email protected]>
> Subject: Re: [osgi-dev] BundleTracker question
>
>> Does your addingBundle method return a non-null value to cause the bundle to
>> be tracked? If you don't do this, then you will never get a modifiedBundle
>> call for that bundle (since it is not tracked.)
>> --
>> BJ Hargrave
>> Senior Technical Staff Member, IBM
>> OSGi Fellow and CTO of the OSGi Alliance
>> [email protected]
>>
>> office: +1 386 848 1781
>> mobile: +1 386 848 3788
>>
>>
>>
>>
>> From: Tim Diekmann <[email protected]>
>> To: OSGi Developer Mail List <[email protected]>
>> Date: 2013/09/19 21:32
>> Subject: [osgi-dev] BundleTracker question
>> Sent by: [email protected]
>>
>>
>>
>> Small question for the experts.
>>
>> A BundleTracker with the arguments
>>
>> Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.ACTIVE |
>> Bundle.STOPPING
>>
>> Gets a callback to addingBundle for any Bundle in INSTALLED state. That is,
>> an bundle.install() call synchronously calls all BundleTrackers with the new
>> Bundle.
>>
>> Why does the BundleTracker not get a callback to the modifiedBundle() method
>> when the bundle is subsequently refreshed and reaches RESOLVED state? I see
>> BundleEvents for the state change, but no callback.
>>
>> Tested with Equinox 3.9.0. Any ideas?
>>
>> Tim.
>> _______________________________________________
>> OSGi Developer Mail List
>> [email protected]
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev