diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-16 08:00:07 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-16 08:00:07 +0000 |
commit | 470b39aa65d741e349a3fbcaa0be1f075a61a090 (patch) | |
tree | 47fb66009b2d1b0272af6dcbc6dfb28e571b62ef /java | |
parent | 825f3fa980c343cd85e67b8add68949724980feb (diff) |
Update launcher to support the client access
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@880649 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r-- | java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java | 23 |
1 files changed, 22 insertions, 1 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 84affffc46..275e0a75c7 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 @@ -138,6 +138,20 @@ public class LauncherMain { return new URLClassLoader(jarURLs.toArray(new URL[]{}), parentCL); } + private static void argJars(Set<URL> jarURLs, Properties launcherProperties) throws IOException { + String[] args = (String[])launcherProperties.get(LAUNCHER_ARGS); + if (args != null && args.length > 0) { + for (String a : args) { + File f = new File(a); + if (!f.exists()) { + throw new FileNotFoundException(args[0]); + } + jarURLs.add(f.toURI().toURL()); + } + } + launcherProperties.put(LAUNCHER_ARGS, new String[]{}); + } + private static URL firstArgJarManifestMainClass(Properties launcherProperties) throws IOException { String[] args = (String[])launcherProperties.get(LAUNCHER_ARGS); if (args.length < 1) { @@ -274,7 +288,14 @@ public class LauncherMain { if (!f.exists()) { // throw new FileNotFoundException(f.getName()); - properties.put("mainClass", "[firstArgJarManifestMainClass]|org.apache.tuscany.sca.domain.node.DomainNodeMain"); + if (args.length > 0 && "client".equals(args[0])) { + properties.put("mainClass", "org.apache.tuscany.sca.client.javascript.TuscanyShell"); + String[] args2 = new String[args.length-1]; + System.arraycopy(args, 1, args2, 0, args.length-1); + args = args2; + } else { + properties.put("mainClass", "[firstArgJarManifestMainClass]|org.apache.tuscany.sca.domain.node.DomainNodeMain"); + } } else { try { FileInputStream fis = new FileInputStream(f); |