Community
Participate
Working Groups
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.
Created attachment 78552 [details] patch for the proposed behaviour
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.)
Patch released into CVS Head.