summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca')
-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) {