diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-27 02:39:37 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-27 02:39:37 +0000 |
commit | 80883ba80a2778eacd3c4f1c687f3fd15fc8e745 (patch) | |
tree | feb63446d200b0ef125d89f5039f0f957bc3a1e8 /java/sca/modules | |
parent | b2651f2ac1fa7994db12a6a1d6af8e8869883588 (diff) |
Pass properties from a parent domain or node manager to child node when starting it in a separate JVM. The properties used by the Node runtime to find the Tuscany install dir were not passed before causing ClassNotFound exceptions in nodes started by the domain manager when the domain manager was started by the Tuscany Eclipse plugin.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@689340 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r-- | java/sca/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/java/sca/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java b/java/sca/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java index a1022d2677..019c2562ec 100644 --- a/java/sca/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java +++ b/java/sca/modules/node-manager/src/main/java/org/apache/tuscany/sca/implementation/node/manager/NodeProcessCollectionImpl.java @@ -224,8 +224,25 @@ public class NodeProcessCollectionImpl implements ItemCollection, LocalItemColle String java = props.getProperty("java.home") + "/bin/java"; String cp = props.getProperty("java.class.path"); String main = NodeLauncher.class.getName(); - final String[] command = new String[]{ java, "-cp", cp, main , nodeConfigurationURI}; + final List<String> command = new ArrayList<String>(); + command.add(java); + command.add("-cp"); + command.add(cp); + + // Propagate TUSCANY properties + String tuscanyHome = props.getProperty("TUSCANY_HOME"); + if (tuscanyHome != null) { + command.add("-DTUSCANY_HOME=" + tuscanyHome); + } + String tuscanyPath = props.getProperty("TUSCANY_PATH"); + if (tuscanyPath != null) { + command.add("-DTUSCANY_PATH=" + tuscanyPath); + } + // Specify the main class and parameters + command.add(main); + command.add(nodeConfigurationURI); + logger.info("Starting " + "java " + main + " " + nodeConfigurationURI); // Start the VM |