import org.argeo.api.a2.A2Source;
import org.argeo.api.a2.FsA2Source;
import org.argeo.api.init.InitConstants;
+import org.argeo.api.init.RuntimeContext;
import org.argeo.cms.CmsDeployProperty;
+import org.argeo.init.osgi.OsgiRuntimeContext;
import org.argeo.slc.WellKnownConstants;
import org.argeo.slc.build.Distribution;
import org.argeo.slc.cms.deploy.CmsDeployedSystem;
private CmsDeployedSystem deployedSystem;
+ private OsgiRuntimeContext runtimeContext;
+
@Override
public void run() {
try {
}
// FIXME use runtime manager
-// runtimeContext = new OsgiRuntimeContext(config);
-// runtimeContext.run();
+ runtimeContext = new OsgiRuntimeContext(config);
+ runtimeContext.run();
// deployedSystem = new OsgiCmsDeployedSystem(runtimeContext.getFramework().getBundleContext(), distribution,
// targetData, deploymentData);
this.distribution = (A2Distribution) distribution;
}
+ public OsgiRuntimeContext getRuntimeContext() {
+ return runtimeContext;
+ }
+
public static void main(String[] args) {
+ RuntimeContext runtimeContext = test();
+ try {
+ runtimeContext.waitForStop(0);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static RuntimeContext test() {
try {
Path userHome = Paths.get(System.getProperty("user.home"));
boolean multiple = true;
if (multiple) {
// wait a bit
- Thread.sleep(5000);
+// Thread.sleep(5000);
Path instanceData2 = userHome.resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment2/data");
Files.createDirectories(instanceData2);
deployment2.run();
}
- // deployment.getRuntimeContext().waitForStop(0);
-
- } catch (IOException | InterruptedException e) {
+ return deployment.getRuntimeContext();
+ } catch (IOException e) {
e.printStackTrace();
System.exit(1);
+ return null;
}
}
import java.nio.file.Paths;
import org.argeo.api.cms.CmsLog;
-import org.argeo.api.init.InitConstants;
import org.argeo.api.init.RuntimeManager;
import org.argeo.cms.CmsDeployProperty;
import org.osgi.framework.BundleActivator;
@Override
public void start(BundleContext context) throws Exception {
Path userHome = Paths.get(System.getProperty("user.home"));
-// OsgiCmsDeployment.main(new String[0]);
+
+// {
+// EquinoxFactory equinoxFactory = new EquinoxFactory();
+// Map<String, String> config = new HashMap<>();
+// config.put("osgi.console", "host1:2023");
+// config.put("osgi.frameworkParentClassloader", "app");
+// config.put("osgi.parentClassLoader", "app");
+// RuntimeManager.loadConfig(Paths.get("/usr/local/etc/argeo/user/cms/test3"), config);
+// Framework framework = equinoxFactory.newFramework(config);
+// framework.start();
+// OsgiBoot osgiBoot = new OsgiBoot(framework.getBundleContext());
+// osgiBoot.bootstrap(config);
+// }
+
+ // OsgiCmsDeployment.test();
+
runtimeManagerSt = new ServiceTracker<>(context, RuntimeManager.class, null) {
@Override
// return;
// }
- runtimeManager.startRuntime("cms/test1", (config) -> {
+ runtimeManager.startRuntime("native/test1", (config) -> {
config.put("osgi.console", "host1:2023");
config.put(CmsDeployProperty.SSHD_PORT.getProperty(), "2222");
config.put(CmsDeployProperty.HTTP_PORT.getProperty(), "7070");
// System.out.println(key + "=" + config.get(key));
//// log.debug(() -> key + "=" + config.get(key));
// }
+// config.put("argeo.osgi.start.6", "org.argeo.swt.minidesktop");
});
runtimeManager.startRuntime("native/test2", (config) -> {
config.put("osgi.console", "host2:2023");
config.put(CmsDeployProperty.SSHD_PORT.getProperty(), "2222");
// config.put(CmsDeployProperty.HTTP_PORT.getProperty(), "7070");
config.put(CmsDeployProperty.HOST.getProperty(), "host2");
- config.put("argeo.osgi.start.6", "org.argeo.swt.minidesktop");
-// config.put("argeo.directory", "ipa:///");
+// config.put("argeo.osgi.start.6", "org.argeo.swt.minidesktop");
+//// config.put("argeo.directory", "ipa:///");
// Path instanceData = userHome
// .resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment/data");
// config.put(InitConstants.PROP_OSGI_INSTANCE_AREA, instanceData.toUri().toString());