From: Mathieu Baudier Date: Thu, 7 Mar 2024 15:23:52 +0000 (+0100) Subject: Adapt to changes in Argeo Build and Argeo Commons X-Git-Tag: v2.3.15~9 X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-slc.git;a=commitdiff_plain;h=82fcb6324dc57a36a8c9c4f4b0e564a1f4ef97de Adapt to changes in Argeo Build and Argeo Commons --- diff --git a/Makefile b/Makefile index 07b6e9990..9d48b5e46 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ log/syslogger/org.argeo.tp \ org.argeo.tp \ org.argeo.tp.httpd \ org.argeo.tp.sys \ -osgi/api/org.argeo.tp.osgi \ +osgi/equinox/org.argeo.tp.osgi \ osgi/equinox/org.argeo.tp.eclipse \ swt/rap/org.argeo.tp.swt \ swt/rap/org.argeo.tp.swt.workbench \ diff --git a/Makefile-rcp.mk b/Makefile-rcp.mk index eb3fc7042..439563147 100644 --- a/Makefile-rcp.mk +++ b/Makefile-rcp.mk @@ -12,7 +12,7 @@ swt/rcp/org.argeo.tool.desktop \ DEP_CATEGORIES = \ org.argeo.tp \ -osgi/api/org.argeo.tp.osgi \ +osgi/equinox/org.argeo.tp.osgi \ osgi/equinox/org.argeo.tp.eclipse \ swt/rcp/org.argeo.tp.swt \ lib/linux/x86_64/swt/rcp/org.argeo.tp.swt \ diff --git a/org.argeo.slc.cms/bnd.bnd b/org.argeo.slc.cms/bnd.bnd index 1c0334fb0..737ccf8cd 100644 --- a/org.argeo.slc.cms/bnd.bnd +++ b/org.argeo.slc.cms/bnd.bnd @@ -6,4 +6,8 @@ org.apache.commons.logging,\ org.postgresql;version="[42,43)";resolution:=optional,\ org.apache.commons.vfs2.*;resolution:=optional,\ org.osgi.*;version="0.0.0",\ +javax.servlet,\ +javax.servlet.http,\ +javax.websocket,\ +javax.websocket.server,\ * \ No newline at end of file diff --git a/org.argeo.slc.cms/src/org/argeo/slc/cms/deploy/osgi/OsgiCmsDeployment.java b/org.argeo.slc.cms/src/org/argeo/slc/cms/deploy/osgi/OsgiCmsDeployment.java index 77d72faf7..1c472e70f 100644 --- a/org.argeo.slc.cms/src/org/argeo/slc/cms/deploy/osgi/OsgiCmsDeployment.java +++ b/org.argeo.slc.cms/src/org/argeo/slc/cms/deploy/osgi/OsgiCmsDeployment.java @@ -15,7 +15,9 @@ import java.util.TreeMap; 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; @@ -38,6 +40,8 @@ public class OsgiCmsDeployment implements Deployment { private CmsDeployedSystem deployedSystem; + private OsgiRuntimeContext runtimeContext; + @Override public void run() { try { @@ -100,8 +104,8 @@ public class OsgiCmsDeployment implements Deployment { } // 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); @@ -132,7 +136,20 @@ public class OsgiCmsDeployment implements Deployment { 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")); @@ -187,7 +204,7 @@ public class OsgiCmsDeployment implements Deployment { 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); @@ -200,11 +217,11 @@ public class OsgiCmsDeployment implements Deployment { deployment2.run(); } - // deployment.getRuntimeContext().waitForStop(0); - - } catch (IOException | InterruptedException e) { + return deployment.getRuntimeContext(); + } catch (IOException e) { e.printStackTrace(); System.exit(1); + return null; } } diff --git a/org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java b/org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java index 7c6de1ced..542aac91c 100644 --- a/org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java +++ b/org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java @@ -4,7 +4,6 @@ import java.nio.file.Path; 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; @@ -20,7 +19,22 @@ public class SlcInitActivator implements 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 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 @@ -35,7 +49,7 @@ public class SlcInitActivator implements BundleActivator { // 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"); @@ -44,14 +58,15 @@ public class SlcInitActivator implements BundleActivator { // 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()); diff --git a/sdk/argeo-build b/sdk/argeo-build index 6f8e29e85..e021d17c0 160000 --- a/sdk/argeo-build +++ b/sdk/argeo-build @@ -1 +1 @@ -Subproject commit 6f8e29e850f9fcfa5149e296e650355fab930752 +Subproject commit e021d17c09f8586a68177e9eb40d9caa088c37b1