-
Notifications
You must be signed in to change notification settings - Fork 779
ChannelItemProvider depends on bundle start order #1550
Comments
Continue from: #1519 (comment)
So, what can we do to solve this? |
Unfortunately it is not possible to subscribe to the ThingTypeRegistry as a listener to be informed when new thing types become available. I could instead directly depend on ThingTypeProviders and refresh the constructed item list if there is any change. But it is probably cleaner to add a listener possibility to the registry, what do you think? |
With PR https://github.com/eclipse/smarthome/pull/1419/files we have a mechanismus to be informed if a bundle loading has been finished. WDYT? |
…ed to the system. Fixes eclipse-archived#1550 Signed-off-by: Kai Kreuzer <[email protected]>
Steps to reproduce the problem: #1661 (comment) |
Ok, you are right. I actually misunderstood #1419 - my expectation was that the XMLThingTypeProvider is also only added once all xmls are processed. Instead it is registered and provides an empty result list, which is then silently filled later on. So my fix indeed misses the point here. :-( |
Sorry, I meant to close the PR, not the issue. |
Seems to be fixed. |
#1288 introduced the ChannelItemProvider
If I understand the mechanism correctly, the "virtual" items are now created (createItemForLink) if a Thing or a ItemChannelLink has been added.
It seems to me that (at least) on startup it is possible that "createItemForLink" is called before all the bundle XMLs are completely parsed (see: #1519 (comment)).
I can reproduce the error here in a Karaf container where the most ESH bundles are using the same start-level (I am using the our karaf and karaf-tp features).
I can workaround that startup behavior if I increase the start-level of the core.thing bundle.
The text was updated successfully, but these errors were encountered: