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,
targetData.getInstanceData().toRealPath().toUri().toString());
+
+ if (targetData.getHost() != null) {
+ config.put(CmsDeployProperty.HOST.getProperty(), targetData.getHost().toString());
+ }
+
if (targetData.getHttpPort() != null) {
config.put(CmsDeployProperty.HTTP_PORT.getProperty(), targetData.getHttpPort().toString());
}
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);
}
}
"sun.security.util,sun.security.internal.spec,sun.security.provider,com.sun.net.httpserver,com.sun.jndi.ldap,com.sun.jndi.ldap.sasl,com.sun.jndi.dns,com.sun.security.jgss,com.sun.nio.file,com.sun.nio.sctp");
config.put("eclipse.ignoreApp", "true");
config.put("osgi.noShutdown", "true");
-
+ config.put("osgi.clean", "true");
+ config.put("osgi.framework.useSystemProperties", "false");
+
config.put("argeo.directory", "dc=example,dc=com.ldif");
- if (targetData instanceof OsgiCmsTargetData osgiCmsTargetData && osgiCmsTargetData.getTelnetPort() != null)
- config.put("osgi.console", osgiCmsTargetData.getTelnetPort().toString());
+ if (targetData instanceof OsgiCmsTargetData osgiCmsTargetData
+ && osgiCmsTargetData.getTelnetPort() != null) {
+ String hostStr = "";
+ if (targetData.getHost() != null) {
+ hostStr = targetData.getHost().toString() + ":";
+ }
+ config.put("osgi.console", hostStr + osgiCmsTargetData.getTelnetPort().toString());
+ }
// initialise
for (String key : config.keySet()) {
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"));
xOr.put("swt", "rap");
xOr.put("log", "syslogger");
xOr.put("crypto", "fips");
- distribution.getA2Sources().add(new FsA2Source(a2Base, xOr, true));
+ distribution.getA2Sources().add(new FsA2Source(a2Base, xOr, true, null, null));
// target data
Path instanceData = userHome.resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment/data");
Files.createDirectories(instanceData);
- OsgiCmsTargetData targetData = new OsgiCmsTargetData(instanceData, 7070, 2323);
+ OsgiCmsTargetData targetData = new OsgiCmsTargetData(instanceData, "host1", 7070, 2323);
// deployment data
SimpleCmsDeploymentData deploymentData = new SimpleCmsDeploymentData();
Path instanceData2 = userHome.resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment2/data");
Files.createDirectories(instanceData2);
- OsgiCmsTargetData targetData2 = new OsgiCmsTargetData(instanceData2, 7071, 2324);
+ OsgiCmsTargetData targetData2 = new OsgiCmsTargetData(instanceData2, "host2", 7070, 2323);
OsgiCmsDeployment deployment2 = new OsgiCmsDeployment();
deployment2.setDistribution(distribution);