X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.init%2Fsrc%2Forg%2Fargeo%2Finit%2Fa2%2FProvisioningManager.java;h=92df47ea8f744e6d587a21c7baf91db2ea067377;hb=71d0bea8d7aa3592f7f2b7c89bb8dd91b6d8bb6d;hp=6a0836bdfdea80ffc6727140e49d2dd3dcd3a470;hpb=a893bef98a50cbe52949dbea9e51881f436a4af4;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.init/src/org/argeo/init/a2/ProvisioningManager.java b/org.argeo.init/src/org/argeo/init/a2/ProvisioningManager.java index 6a0836bdf..92df47ea8 100644 --- a/org.argeo.init/src/org/argeo/init/a2/ProvisioningManager.java +++ b/org.argeo.init/src/org/argeo/init/a2/ProvisioningManager.java @@ -149,21 +149,28 @@ public class ProvisioningManager { Version moduleVersion = module.getVersion(); A2Branch osgiBranch = osgiContext.findBranch(module.getBranch().getComponent().getId(), moduleVersion); if (osgiBranch == null) { -// Bundle bundle = bc.installBundle(module.getBranch().getCoordinates(), -// moduleSource.newInputStream(module.getLocator())); Bundle bundle = moduleSource.install(bc, module); - if (OsgiBootUtils.isDebug()) - OsgiBootUtils.debug("Installed bundle " + bundle.getLocation() + " with version " + moduleVersion); + // TODO make it more dynamic, based on OSGi APIs + osgiContext.registerBundle(bundle); +// if (OsgiBootUtils.isDebug()) +// OsgiBootUtils.debug("Installed bundle " + bundle.getLocation() + " with version " + moduleVersion); return bundle; } else { A2Module lastOsgiModule = osgiBranch.last(); int compare = moduleVersion.compareTo(lastOsgiModule.getVersion()); if (compare > 0) {// update Bundle bundle = (Bundle) lastOsgiModule.getLocator(); -// bundle.update(moduleSource.newInputStream(module.getLocator())); moduleSource.update(bundle, module); + // TODO make it more dynamic, based on OSGi APIs + // TODO remove old module? Or keep update history? + osgiContext.registerBundle(bundle); OsgiBootUtils.info("Updated bundle " + bundle.getLocation() + " to version " + moduleVersion); return bundle; + } else { + if (OsgiBootUtils.isDebug()) + OsgiBootUtils.debug("Did not install as bundle module " + module + + " since a module with higher version " + lastOsgiModule.getVersion() + + " is already installed for branch " + osgiBranch); } } } catch (Exception e) {