cmdList.add(app.getExecutableLocation()); cmdList.addAll(tmp);
public void setupEnvironment(InvocationContext context) throws ProviderException { ApplicationDeploymentDescriptionType app = context.getExecutionDescription().getApp().getType(); // input parameter ArrayList<String> tmp = new ArrayList<String>(); for (Iterator<String> iterator = context.getInput().getNames(); iterator.hasNext();) { String key = iterator.next(); tmp.add(context.getInput().getStringValue(key)); } List<String> cmdList = new ArrayList<String>(); /* * Builder Command */ cmdList.add(app.getExecutableLocation()); cmdList.addAll(tmp); // create process builder from command command = InputUtils.buildCommand(cmdList); // redirect StdOut and StdErr // TODO: Make 1> and 2> into static constants. // TODO: This only works for the BASH shell. CSH and TCSH will be // different. command += SPACE + "1>" + SPACE + app.getStandardOutput(); command += SPACE + "2>" + SPACE + app.getStandardError(); }
public static ApplicationDescriptor createApplicationDescriptor (ApplicationDescription applicationDescription){ ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor(); applicationDescriptor.setName(applicationDescription.getType().getApplicationName().getStringValue()); applicationDescriptor.setExecutablePath(applicationDescription.getType().getExecutableLocation()); applicationDescriptor.setWorkingDir(applicationDescription.getType().getScratchWorkingDirectory());