+ protected String[] getVmArguments(SlcSystem deployedSlc) {\r
+ List<String> list = new Vector<String>();\r
+ if (deployedSlc.getJavaLibraryPath() != null)\r
+ list.add("-Djava.library.path=" + deployedSlc.getJavaLibraryPath());\r
+ return list.toArray(new String[list.size()]);\r
+ }\r
+\r
+ protected String[] getProgramArguments(SlcSystem deployedSlc, IFile file,\r
+ String mode, ILaunchConfiguration configuration)\r
+ throws CoreException {\r
+ List<String> list = new Vector<String>();\r
+\r
+ list.add("--mode");\r
+ list.add("single");\r
+\r
+ // Script\r
+ list.add("--script");\r
+ list.add(file.getLocation().toFile().getAbsolutePath());\r
+\r
+ // Runtime\r
+ String runtime = configuration.getAttribute(ATTR_RUNTIME, "");\r
+ if (!runtime.equals("")) {\r
+ list.add("--runtime");\r
+ list.add(runtime);\r
+ }\r
+\r
+ // Targets\r
+ String targets = configuration.getAttribute(ATTR_RUNTIME, "");\r
+ if (!runtime.equals("")) {\r
+ list.add("--targets");\r
+ list.add(targets);\r
+ }\r
+\r
+ // Properties\r
+ Properties properties = new Properties();\r
+ StringReader reader = new StringReader(configuration.getAttribute(\r
+ ATTR_PROPERTIES, ""));\r
+ try {\r
+ properties.load(reader);\r
+ } catch (IOException e) {\r
+ throw new RuntimeException("Cannot read properties", e);\r
+ } finally {\r
+ if (reader != null)\r
+ reader.close();\r
+ }\r
+\r
+ for (Object key : properties.keySet()) {\r
+ list.add("-p");\r
+ StringBuffer buf = new StringBuffer("");\r
+ buf.append(key).append('=').append(properties.get(key));\r
+ list.add(buf.toString());\r
+ }\r
+\r
+ // Debug mode\r
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {\r
+ list.add("--property");\r
+ list.add("log4j.logger.org.argeo.slc=DEBUG");\r
+ }\r
+ return list.toArray(new String[list.size()]);\r
+ }\r
+\r
+ // Pre SLC v0.9.3\r
+ protected VMRunnerConfiguration createPre093Config(SlcSystem deployedSlc,\r
+ IFile file, String mode) throws CoreException {\r
+ VMRunnerConfiguration vmConfig = new VMRunnerConfiguration(ANT_MAIN,\r
+ deployedSlc.getClasspath());\r
+ vmConfig.setVMArguments(getPre093VmArguments(deployedSlc));\r
+ vmConfig.setWorkingDirectory(file.getLocation().toFile().getParent());\r
+ vmConfig.setProgramArguments(getPre093ProgramArguments(deployedSlc,\r
+ file, mode));\r
+ return vmConfig;\r
+ }\r
+\r
+ protected String[] getPre093VmArguments(SlcSystem deployedSlc) {\r