Bug 203599 - [Registry] Events are not delivered if jobs bundle has been stopped
Summary: [Registry] Events are not delivered if jobs bundle has been stopped
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: equinox.compendium-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-09-17 10:51 EDT by Danail Nachev CLA
Modified: 2008-01-07 17:09 EST (History)
1 user (show)

See Also:


Attachments
patch for the proposed behaviour (914 bytes, patch)
2007-09-17 10:52 EDT, Danail Nachev CLA
no flags Details | Diff
Updated patch (1.65 KB, patch)
2008-01-07 17:07 EST, Oleg Besedin CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Danail Nachev CLA 2007-09-17 10:51:04 EDT
If jobs bundle has been stopped, then registry events won't be able to be delivered, because schedule() method call will fail (EquinoxRegistryStrategy.scheduleChangeEvent()).

This is very rare situation, but I think registry should try to deliver change event in all cases.

So, I propose we add one more catch block to catch Exception and then use the superclass strategy for delivering events.

This introduce the chance to deliver single event twice to the listeners, because we may wrongly assume that the job hasn't been scheduled, but I think it is more important to deliver the event.
Comment 1 Danail Nachev CLA 2007-09-17 10:52:02 EDT
Created attachment 78552 [details]
patch for the proposed behaviour
Comment 2 Oleg Besedin CLA 2008-01-07 17:07:49 EST
Created attachment 86357 [details]
Updated patch

Thanks Danail, it is a nice addition. One thing I'd like to change is to catch more specific exception - java.lang.IllegalStateException that is produced by JobManager rather than java.lang.Exception. 

The processing will be the same as for NoClassDefFoundError - once we can't find the Jobs bundle, we switch to internal processing and don't attempt to go back to ensure that registry notifications remain scheduled in order.

(An interesting side note from this is that after bundle is uninstalled classes are still available to the running instance. Makes sense from Java perspective, but weird from OSGi side.)
Comment 3 Oleg Besedin CLA 2008-01-07 17:09:25 EST
Patch released into CVS Head.