Repository navigation
Handle RESOLVED events in ServiceLoaderMediatorHook.modifiedBundle - #1368
Conversation
|
@HannesWell sadly the javadoc is surprisingly uninformative here https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/BundleEvent.html#RESOLVED the state diagram is what I most often look at for more information
I would say it depends a bit on the code / behavior if one can say it is really "irrelevant" I would at least clear all cached content for that bundle (if there is any) so everything is fetched fresh as it gets a new classloader in such case. |
|
The javaDoc is indeed not very clear on that, unfortunately.
Only information about the content of the bundle itself is cached. The wiring is read 'freshly' whenever considered. It seems to me that we only receive an RESOLVED event if the wiring changes and that doesn't require a refresh of cached data. Since this is a fix for an existing issue, I'm submitting this now. If my assumption later to turn out to be wrong, we can still improve it. |
If another bundle is updated (or new ones installed) or even uninstalled the wiring remains unless you force a refresh, so it should not have an influence of the content of the bundle itself, on the other hand it show in the diagram that an update of an bundle can lead to resolve again(not sure if this then gets an event...) what would e.g. possibly make the bundle change contained resources and classes. |
This is the state mask you use: I am surprised you are seeing the Note that when the tracker is opened all bundle states that match the state mask will be passed to What I've usually done is had |
|
BTW this is the diagram you want to refer to for bundle states. The one referred to earlier was for the framework states, which will confuse you. |

A
ServiceTrackerthat tracks bundles in stateBundle.RESOLVED | Bundle.STARTING | Bundle.ACTIVE | Bundle.STOPPINGreceives calls tomodifiedBundle()where the event is RESOLVED again, if the wiring is updated, e.g. because new bundles were resolved.@laeubi or @tjwatson is that assumption correct or are there other cases, that might be relevant here?