@Override
protected Map<String, ?> processOutput(InvocationContext invocationContext) throws ProviderException {
GlobusHostType host = (GlobusHostType) invocationContext.getExecutionDescription().getHost().getType();
ApplicationDeploymentDescriptionType app = invocationContext.getExecutionDescription().getApp().getType();
GridFtp ftp = new GridFtp();
File localStdErrFile = null;
try {
GSSCredential gssCred = gssContext.getGssCredentails();
String[] hostgridFTP = host.getGridFTPEndPointArray();
if (hostgridFTP == null || hostgridFTP.length == 0) {
hostgridFTP = new String[] { host.getHostAddress() };
}
boolean success = false;
ProviderException pe = new ProviderException("");
for (String endpoint : host.getGridFTPEndPointArray()) {
try {
/*
* Read Stdout and Stderror
*/
URI stdoutURI = GfacUtils.createGsiftpURI(endpoint, app.getStandardOutput());
URI stderrURI = GfacUtils.createGsiftpURI(endpoint, app.getStandardError());
log.info("STDOUT:" + stdoutURI.toString());
log.info("STDERR:" + stderrURI.toString());
File logDir = new File("./service_logs");
if (!logDir.exists()) {
logDir.mkdir();
}
String timeStampedServiceName = GfacUtils.createUniqueNameForService(invocationContext
.getServiceName());
File localStdOutFile = File.createTempFile(timeStampedServiceName, "stdout");
localStdErrFile = File.createTempFile(timeStampedServiceName, "stderr");
String stdout = ftp.readRemoteFile(stdoutURI, gssCred, localStdOutFile);
String stderr = ftp.readRemoteFile(stderrURI, gssCred, localStdErrFile);
Map<String,ActualParameter> stringMap = null;
stringMap = OutputUtils.fillOutputFromStdout(invocationContext.<ActualParameter>getOutput(), stdout);
MessageContext<Object> output = invocationContext.getOutput();
for (Iterator<String> iterator = output.getNames(); iterator.hasNext(); ) {
String paramName = iterator.next();