+
+ Map<String, String> configuration = new HashMap<String, String>();
+ configuration.put("osgi.configuration.area",
+ confDir.getCanonicalPath());
+ configuration.put("osgi.instance.area", dataDir.getCanonicalPath());
+ // Do clean
+ configuration.put("osgi.clean", "true");
+
+ JvmProcess osgiRuntime = new JvmProcess();
+ osgiRuntime.setExecDir(baseDirectory.getCanonicalPath());
+ if (equinoxJar == null)
+ throw new SlcException("Cannot find OSGi runtime.");
+ osgiRuntime.setMainJar(equinoxJar.getCanonicalPath());
+ osgiRuntime.arg("-configuration", confDir.getCanonicalPath())
+ .arg("-data", dataDir.getCanonicalPath())
+ .arg("-console", "7777").arg("-clean");
+ osgiRuntime.setLogCommand(true);
+ osgiRuntime.afterPropertiesSet();
+ osgiRuntime.run();
+
+ // Map<String, String> configuration = new HashMap<String,
+ // String>();
+ // configuration.put("osgi.configuration.area",
+ // confDir.getCanonicalPath());
+ // configuration.put("osgi.instance.area",
+ // dataDir.getCanonicalPath());
+ // // Do clean
+ // configuration.put("osgi.clean", "true");
+ // ServiceLoader<FrameworkFactory> ff = ServiceLoader
+ // .load(FrameworkFactory.class);
+ // FrameworkFactory frameworkFactory = ff.iterator().next();
+ // Framework framework =
+ // frameworkFactory.newFramework(configuration);
+ // framework.start();
+ // BundleContext testBundleContext = framework.getBundleContext();
+
+ // for (int i = 0; i < files.size(); i++) {
+ // testBundleContext.installBundle("file://"
+ // + files.get(i).getCanonicalPath());
+ // }
+ //
+ // Bundle[] testBundles = testBundleContext.getBundles();
+ // for (Bundle bundle : testBundles) {
+ // if (log.isDebugEnabled())
+ // log.debug(bundle.getSymbolicName() + " "
+ // + bundle.getVersion());
+ // }
+