I’m trying to look into the handling of add-ons, JAR and KAR files specifically at this time.
Marketplace add-on bundles are placed in a “cache folder” (userdata/marketplace/bundles
). From there, they are “installed” into the OSGi framework as a Bundle
.
What I can’t figure out is if this “framework” is supposed to survive stopping and starting of OH, rebooting of the server etc. On my development computer, a new temp folder (e.g osgi.9989297376058944334.fw
) seems to be created every time I start OH. Thus, everything have to be “installed” every time OH is started. This seems to be consistent with what I’m observing, add-ons are “installed” from the cache each time “demo app” is started.
However, the design of org.openhab.core.addon.marketplace.MarketplaceBundleInstaller.ensureCachedBundlesAreInstalled()
indicates that this isn’t supposed to be the “normal” behavior:
/**
* Iterates over the local cache entries and re-installs bundles that are missing
*
* @param bundleContext the {@link BundleContext} to use to look up the bundles
*/
protected void ensureCachedBundlesAreInstalled(BundleContext bundleContext) {
It also logs the installation of the add-ons like this:
logger.info("Reinstalling missing marketplace bundle: {}", addonId);
So, I’m confused by the difference between what I observe and the design of the code handling it. Is it so that the “framework container” is only recreated for each run in the “demo app”, and that it is in fact reused in “normal” OH installations?
If so, I’m wondering if there’s a way I can simulate this behavior to see how startup behaves under those circumstances?