summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-02-06 09:14:31 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-02-06 09:14:31 +0000
commited794ad79172c9ed8639581119ad6e675f411b93 (patch)
treee643115e2f00d83d7a9efd96e8834be978937435
parentb7b5bd32d8315c1075f473c1ceae87744751cc7c (diff)
Enable setting system properties from the config files
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@741480 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
index b23fc675fe..04f2d0b906 100644
--- a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
+++ b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
@@ -48,12 +48,22 @@ public class LauncherMain {
public static void main(String[] args) throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, URISyntaxException, IOException {
Properties launcherProperties = getLauncherProperties(args);
+ setSystemProperties(launcherProperties);
ClassLoader classLoader = getClassLoader(launcherProperties);
String mainClassName = getMainClass(launcherProperties, classLoader);
String[] mainArgs = getMainArgs(launcherProperties);
invokeMainMethod(mainClassName, classLoader, mainArgs);
}
+ private static void setSystemProperties(Properties launcherProperties) {
+ for (Enumeration<?> e = launcherProperties.propertyNames(); e.hasMoreElements();) {
+ String pn = (String) e.nextElement();
+ if (pn.startsWith("-D")) {
+ System.setProperty(pn.substring(2), launcherProperties.getProperty(pn));
+ }
+ }
+ }
+
private static String[] getMainArgs(Properties launcherProperties) {
String[] mainArgs = (String[])launcherProperties.get(LAUNCHER_ARGS);
if (mainArgs == null) {