import java.util.StringJoiner;
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.cms.CmsDeployProperty;
-import org.argeo.init.a2.A2Source;
-import org.argeo.init.a2.FsA2Source;
-import org.argeo.init.osgi.OsgiBoot;
-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 {
for (A2Source a2Source : distribution.getA2Sources()) {
sourcesProperty.add(a2Source.getUri().toString());
}
- config.put(OsgiBoot.PROP_ARGEO_OSGI_SOURCES, sourcesProperty.toString());
+ config.put(InitConstants.PROP_ARGEO_OSGI_SOURCES, sourcesProperty.toString());
// target
config.put(WellKnownConstants.OSGI_INSTANCE_AREA,
List<String> modules = deploymentData.getModulesToActivate(startLevel);
if (modules.size() != 0) {
String startProperty = String.join(",", modules);
- config.put(OsgiBoot.PROP_ARGEO_OSGI_START + "." + startLevel, startProperty);
+ config.put(InitConstants.PROP_ARGEO_OSGI_START + "." + startLevel, startProperty);
}
}
logger.log(Level.TRACE, () -> key + "=" + config.get(key));
}
- runtimeContext = new OsgiRuntimeContext(config);
- runtimeContext.run();
+ // FIXME use runtime manager
+// runtimeContext = new OsgiRuntimeContext(config);
+// runtimeContext.run();
- deployedSystem = new OsgiCmsDeployedSystem(runtimeContext.getFramework().getBundleContext(), distribution,
- targetData, deploymentData);
+// deployedSystem = new OsgiCmsDeployedSystem(runtimeContext.getFramework().getBundleContext(), distribution,
+// targetData, deploymentData);
} catch (Exception e) {
throw new IllegalStateException("Cannot run OSGi deployment", e);
this.distribution = (A2Distribution) distribution;
}
- public OsgiRuntimeContext getRuntimeContext() {
- return runtimeContext;
- }
-
public static void main(String[] args) {
try {
Path userHome = Paths.get(System.getProperty("user.home"));
import java.util.Iterator;
import java.util.List;
-import org.argeo.init.a2.A2Branch;
-import org.argeo.init.a2.A2Component;
-import org.argeo.init.a2.A2Contribution;
-import org.argeo.init.a2.A2Module;
-import org.argeo.init.a2.A2Source;
+import org.argeo.api.a2.A2Branch;
+import org.argeo.api.a2.A2Component;
+import org.argeo.api.a2.A2Contribution;
+import org.argeo.api.a2.A2Module;
+import org.argeo.api.a2.A2Source;
import org.argeo.slc.CategoryNameVersion;
import org.argeo.slc.DefaultCategoryNameVersion;
import org.argeo.slc.NameVersion;
package org.argeo.slc.init.osgi;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
import org.argeo.api.cms.CmsLog;
+import org.argeo.api.init.RuntimeManager;
import org.argeo.cms.CmsDeployProperty;
-import org.argeo.init.RuntimeManager;
-import org.argeo.init.osgi.OsgiBoot;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@Override
public void start(BundleContext context) throws Exception {
- Path userHome = Paths.get(System.getProperty("user.home"));
+// Path userHome = Paths.get(System.getProperty("user.home"));
// OsgiCmsDeployment.main(new String[0]);
runtimeManagerSt = new ServiceTracker<>(context, RuntimeManager.class, null) {
log.debug("Found runtime manager " + runtimeManager);
new Thread() {
public void run() {
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- return;
- }
+// try {
+// Thread.sleep(5000);
+// } catch (InterruptedException e) {
+// return;
+// }
- runtimeManager.startRuntime("cms/test", (config) -> {
- config.put("osgi.clean", "true");
- // config.put("argeo.osgi.sources", "a2+reference:///?osgi=equinox");
- config.put("osgi.console", "2024");
+ runtimeManager.startRuntime("cms/test1", (config) -> {
+ config.put("osgi.console", "host1:2023");
config.put(CmsDeployProperty.SSHD_PORT.getProperty(), "2222");
-// config.put(CmsDeployProperty.HTTP_PORT.getProperty(), "7070");
-// config.put(CmsDeployProperty.HOST.getProperty(),
-// "localhost");
- Path instanceData = userHome
- .resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment/data");
- config.put(OsgiBoot.PROP_OSGI_INSTANCE_AREA, instanceData.toUri().toString());
- config.put("argeo.directory", "dc=example,dc=com.ldif");
+ config.put(CmsDeployProperty.HTTP_PORT.getProperty(), "7070");
+ config.put(CmsDeployProperty.HOST.getProperty(), "host1");
+// Path instanceData = userHome
+// .resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment/data");
+// config.put(OsgiBoot.PROP_OSGI_INSTANCE_AREA, instanceData.toUri().toString());
+// config.put("argeo.directory", "dc=example,dc=com.ldif");
// for (String key : config.keySet()) {
// System.out.println(key + "=" + config.get(key));
//// log.debug(() -> key + "=" + config.get(key));
// }
});
+ runtimeManager.startRuntime("cms/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");
+ });
}
}.start();
}
};
- runtimeManagerSt.open(true);
+ runtimeManagerSt.open(false);
}
@Override