X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.osgi.boot%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fboot%2FOsgiBoot.java;h=8ca9be77bb1d3b26fdb742dda6a2bcf4189dcee3;hb=1091271b89f2d12e9898e01f6639c48831b1bc4b;hp=effdcf3baf3bc7daf3e46d0692855a667e93001a;hpb=1c0c3d0b0476adfc6489bb08d96daf1e74aea4b3;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java index effdcf3ba..8ca9be77b 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java @@ -31,6 +31,7 @@ import java.util.SortedMap; import java.util.StringTokenizer; import java.util.TreeMap; +import org.argeo.osgi.boot.a2.ProvisioningManager; import org.argeo.osgi.boot.internal.springutil.AntPathMatcher; import org.argeo.osgi.boot.internal.springutil.PathMatcher; import org.argeo.osgi.boot.internal.springutil.SystemPropertyUtils; @@ -50,6 +51,8 @@ import org.osgi.framework.wiring.FrameworkWiring; */ public class OsgiBoot implements OsgiBootConstants { public final static String PROP_ARGEO_OSGI_START = "argeo.osgi.start"; + public final static String PROP_ARGEO_OSGI_SOURCES = "argeo.osgi.sources"; + public final static String PROP_ARGEO_OSGI_BUNDLES = "argeo.osgi.bundles"; public final static String PROP_ARGEO_OSGI_BASE_URL = "argeo.osgi.baseUrl"; public final static String PROP_ARGEO_OSGI_LOCAL_CACHE = "argeo.osgi.localCache"; @@ -90,6 +93,8 @@ public class OsgiBoot implements OsgiBootConstants { private final BundleContext bundleContext; private final String localCache; + private final ProvisioningManager provisioningManager; + /* * INITIALIZATION */ @@ -98,6 +103,16 @@ public class OsgiBoot implements OsgiBootConstants { this.bundleContext = bundleContext; String homeUri = Paths.get(System.getProperty("user.home")).toUri().toString(); localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE, homeUri + ".m2/repository/"); + + provisioningManager = new ProvisioningManager(bundleContext); + String sources = getProperty(PROP_ARGEO_OSGI_SOURCES); + if (sources == null) { + provisioningManager.registerDefaultSource(); + } else { + for (String source : sources.split(",")) { + provisioningManager.registerSource(source); + } + } } /* @@ -113,6 +128,7 @@ public class OsgiBoot implements OsgiBootConstants { .info("OSGi bootstrap starting" + (osgiInstancePath != null ? " (" + osgiInstancePath + ")" : "")); installUrls(getBundlesUrls()); installUrls(getDistributionUrls()); + provisioningManager.install(null); startBundles(); long duration = System.currentTimeMillis() - begin; OsgiBootUtils.info("OSGi bootstrap completed in " + Math.round(((double) duration) / 1000) + "s (" @@ -143,6 +159,9 @@ public class OsgiBoot implements OsgiBootConstants { System.out.println(); } + public void update() { + provisioningManager.update(); + } /* * INSTALLATION */