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;
*/
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";
private final BundleContext bundleContext;
private final String localCache;
+ private final ProvisioningManager provisioningManager;
+
/*
* INITIALIZATION
*/
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);
+ }
+ }
+ }
+
+ ProvisioningManager getProvisioningManager() {
+ return provisioningManager;
}
/*
.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 ("
System.out.println();
}
+ public void update() {
+ provisioningManager.update();
+ }
+
/*
* INSTALLATION
*/