applicationContext.setHostDescription(host);
/*
* App
*/
ApplicationDescription appDesc = new ApplicationDescription();
ApplicationDeploymentDescriptionType app = appDesc.getType();
ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
name.setStringValue("EchoSSH");
app.setApplicationName(name);
/*
* Use bat file if it is compiled on Windows
*/
if (SystemUtils.IS_OS_WINDOWS) {
URL url = this.getClass().getClassLoader().getResource("echo.bat");
app.setExecutableLocation(url.getFile());
} else {
//for unix and Mac
app.setExecutableLocation("/bin/echo");
}
/*
* Job location
*/
String tempDir = "/tmp";
String date = (new Date()).toString();
date = date.replaceAll(" ", "_");
date = date.replaceAll(":", "_");
tempDir = tempDir + File.separator
+ "EchoSSH" + "_" + date + "_" + UUID.randomUUID();
app.setScratchWorkingDirectory(tempDir);
app.setStaticWorkingDirectory(tempDir);
app.setInputDataDirectory(tempDir + File.separator + "input");
app.setOutputDataDirectory(tempDir + File.separator + "output");
app.setStandardOutput(tempDir + File.separator + "echo.stdout");
app.setStandardError(tempDir + File.separator + "echo.stderr");
applicationContext.setApplicationDeploymentDescription(appDesc);
/*
* Service