airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patanac...@apache.org
Subject svn commit: r1166482 - in /incubator/airavata/trunk/modules: gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/ gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/ gfac-core/src/main/java/org/apache/airavat...
Date Thu, 08 Sep 2011 00:49:50 GMT
Author: patanachai
Date: Thu Sep  8 00:49:49 2011
New Revision: 1166482

URL: http://svn.apache.org/viewvc?rev=1166482&view=rev
Log:
Code cleanup

Modified:
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/InvocationContext.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultInvocationContext.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/message/MessageContext.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/factory/EchoLocalServiceFactory.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/registry/RegistryService.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/registry/impl/
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GFacConstants.java

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
(original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
Thu Sep  8 00:49:49 2011
@@ -41,7 +41,6 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.commons.gfac.type.parameter.AbstractParameter;
 import org.apache.airavata.commons.gfac.type.util.SchemaUtil;
-import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
 import org.apache.airavata.core.gfac.context.invocation.impl.DefaultExecutionContext;
 import org.apache.airavata.core.gfac.context.invocation.impl.DefaultInvocationContext;
 import org.apache.airavata.core.gfac.context.message.impl.ParameterContextImpl;
@@ -54,7 +53,6 @@ import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
@@ -192,8 +190,8 @@ public class GFacMessageReciever impleme
                 outputParam.add(parameter.getName(), SchemaUtil.mapFromType(parameter.getType()));
             }
 
-            ct.addMessageContext("input", inputParam);
-            ct.addMessageContext("output", outputParam);
+            ct.addMessageContext(ParameterContextImpl.INPUT_KEY, inputParam);
+            ct.addMessageContext(ParameterContextImpl.OUTPUT_KEY, outputParam);
 
             if (service == null) {
                 service = new PropertyServiceFactory().createService();

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/InvocationContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/InvocationContext.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/InvocationContext.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/InvocationContext.java
Thu Sep  8 00:49:49 2011
@@ -29,7 +29,7 @@ import org.apache.airavata.core.gfac.con
  * a parameter to pass to all modules in the Gfac service.
  * 
  */
-public interface InvocationContext {
+public interface InvocationContext {  
     
     /**
      * Get ServiceName for the invocation
@@ -72,10 +72,6 @@ public interface InvocationContext {
      * @param name
      * @return MessageContext
      */
-	 
-	 //TODO: It may be a good idea to have specific message contexts for input, output, etc.
-	 //Currently this relies on magic names ("output", "input").  Alternatively, these can be
-	 //set to static constants, like MessageContext.INPUT.
     public <T> MessageContext<T> getMessageContext(String name);
 
     /**

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultInvocationContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultInvocationContext.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultInvocationContext.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultInvocationContext.java
Thu Sep  8 00:49:49 2011
@@ -80,7 +80,6 @@ public class DefaultInvocationContext im
         this.messageContextMap.put(name, value);
     }
 
-    @Override
     public <T extends SecurityContext> void addSecurityContext(String name, T value)
{
         this.securityContextMap.put(name, value);        
     };    

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/message/MessageContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/message/MessageContext.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/message/MessageContext.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/message/MessageContext.java
Thu Sep  8 00:49:49 2011
@@ -35,6 +35,17 @@ import java.util.Iterator;
  */
 public interface MessageContext<T> {
 
+    
+    /**
+     * Constant for input message key
+     */
+    public static final String INPUT_KEY = "input";
+    
+    /**
+     * Constant for output message key
+     */
+    public static final String OUTPUT_KEY = "output";  
+    
     /**
      * Get list of names in the context
      * 

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/GridFtpOutputStaging.java
Thu Sep  8 00:49:49 2011
@@ -48,7 +48,7 @@ public class GridFtpOutputStaging extend
 
     public boolean execute(InvocationContext context) throws GfacException {
         try {
-            MessageContext<AbstractParameter> x = context.getMessageContext("output");
+            MessageContext<AbstractParameter> x = context.getMessageContext(MessageContext.OUTPUT_KEY);
 
             for (Iterator<String> iterator = x.getNames(); iterator.hasNext();) {
                 String key = iterator.next();

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/GridFtpInputStaging.java
Thu Sep  8 00:49:49 2011
@@ -39,7 +39,6 @@ import org.apache.airavata.core.gfac.exc
 import org.apache.airavata.core.gfac.exception.GfacException.FaultCode;
 import org.apache.airavata.core.gfac.extension.PreExecuteChain;
 import org.apache.airavata.core.gfac.external.GridFtp;
-import org.apache.airavata.core.gfac.utils.GFacConstants;
 import org.apache.airavata.core.gfac.utils.GfacUtils;
 import org.ietf.jgss.GSSCredential;
 
@@ -50,7 +49,7 @@ public class GridFtpInputStaging extends
     public boolean execute(InvocationContext context) throws GfacException {
         try {
 
-            MessageContext<AbstractParameter> x = context.getMessageContext(GFacConstants.MESSAGE_CONTEXT_INPUT_NAME);
+            MessageContext<AbstractParameter> x = context.getMessageContext(MessageContext.INPUT_KEY);
 
             for (Iterator<String> iterator = x.getNames(); iterator.hasNext();) {
                 String key = iterator.next();

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
Thu Sep  8 00:49:49 2011
@@ -44,7 +44,6 @@ import org.apache.airavata.core.gfac.exc
 import org.apache.airavata.core.gfac.exception.GfacException.FaultCode;
 import org.apache.airavata.core.gfac.extension.PreExecuteChain;
 import org.apache.airavata.core.gfac.external.GridFtp;
-import org.apache.airavata.core.gfac.utils.GFacConstants;
 import org.apache.airavata.core.gfac.utils.GfacUtils;
 import org.ietf.jgss.GSSCredential;
 
@@ -54,7 +53,7 @@ public class HttpInputStaging extends Pr
 
     public boolean execute(InvocationContext context) throws GfacException {
         try {
-            MessageContext<AbstractParameter> x = context.getMessageContext(GFacConstants.MESSAGE_CONTEXT_INPUT_NAME);
+            MessageContext<AbstractParameter> x = context.getMessageContext(MessageContext.INPUT_KEY);
 
             for (Iterator<String> iterator = x.getNames(); iterator.hasNext();) {
                 String key = iterator.next();

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
Thu Sep  8 00:49:49 2011
@@ -49,6 +49,7 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.commons.gfac.type.app.ShellApplicationDeployment;
 import org.apache.airavata.commons.gfac.type.parameter.AbstractParameter;
 import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
+import org.apache.airavata.core.gfac.context.message.MessageContext;
 import org.apache.airavata.core.gfac.context.security.impl.AmazonSecurityContext;
 import org.apache.airavata.core.gfac.exception.GfacException;
 import org.apache.airavata.core.gfac.exception.GfacException.FaultCode;
@@ -240,9 +241,9 @@ public class EC2Provider extends Abstrac
 
      // input parameter
         ArrayList<String> tmp = new ArrayList<String>();
-        for (Iterator<String> iterator = context.getMessageContext(GFacConstants.MESSAGE_CONTEXT_INPUT_NAME).getNames();
iterator.hasNext();) {
+        for (Iterator<String> iterator = context.getMessageContext(MessageContext.INPUT_KEY).getNames();
iterator.hasNext();) {
             String key = iterator.next();
-            tmp.add(context.getMessageContext(GFacConstants.MESSAGE_CONTEXT_INPUT_NAME).getStringValue(key));
+            tmp.add(context.getMessageContext(MessageContext.INPUT_KEY).getStringValue(key));
         }
         
         List<String> cmdList = new ArrayList<String>();
@@ -346,7 +347,7 @@ public class EC2Provider extends Abstrac
                 String stdErrStr = GfacUtils.readFile(localStdErrFile.getAbsolutePath());
 
                 // set to context
-                OutputUtils.fillOutputFromStdout(context.<AbstractParameter>getMessageContext("output"),
stdOutStr, stdErrStr);
+                OutputUtils.fillOutputFromStdout(context.<AbstractParameter>getMessageContext(MessageContext.OUTPUT_KEY),
stdOutStr, stdErrStr);
 
             } catch (Exception e) {
                 throw e;

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java
Thu Sep  8 00:49:49 2011
@@ -32,6 +32,7 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.commons.gfac.type.host.GlobusHost;
 import org.apache.airavata.commons.gfac.type.parameter.AbstractParameter;
 import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
+import org.apache.airavata.core.gfac.context.message.MessageContext;
 import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
 import org.apache.airavata.core.gfac.exception.GfacException;
 import org.apache.airavata.core.gfac.exception.GfacException.FaultCode;
@@ -200,12 +201,11 @@ public class GramProvider extends Abstra
             String stderr = ftp.readRemoteFile(stderrURI, gssCred, localStdErrFile);
 
             // set to context
-            OutputUtils.fillOutputFromStdout(invocationContext.<AbstractParameter>getMessageContext("output"),
stdout, stderr);
+            OutputUtils.fillOutputFromStdout(invocationContext.<AbstractParameter>getMessageContext(MessageContext.OUTPUT_KEY),
stdout, stderr);
 
             jobSucsseful = true;
         } catch (GramException e) {
-            String localHost = "xxxx";
-            GfacException error = new JobSubmissionFault(e, localHost, gatekeeper, rsl, this);
+            GfacException error = new JobSubmissionFault(e, host.getName(), gatekeeper, rsl,
this);
             if (errCode == 8) {
                 error.setFaultCode(ErrorCodes.JOB_CANCELED);
             } else {

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/LocalProvider.java
Thu Sep  8 00:49:49 2011
@@ -33,11 +33,10 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.commons.gfac.type.app.ShellApplicationDeployment;
 import org.apache.airavata.commons.gfac.type.parameter.AbstractParameter;
 import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
+import org.apache.airavata.core.gfac.context.message.MessageContext;
 import org.apache.airavata.core.gfac.exception.GfacException;
 import org.apache.airavata.core.gfac.exception.GfacException.FaultCode;
 import org.apache.airavata.core.gfac.notification.NotificationService;
@@ -70,15 +69,13 @@ public class LocalProvider extends Abstr
     }
 
     public void execute(InvocationContext context) throws GfacException {
-        HostDescription host = context.getExecutionDescription().getHost();
         ShellApplicationDeployment app = (ShellApplicationDeployment)context.getExecutionDescription().getApp();
-        ServiceDescription service = context.getExecutionDescription().getService();
         
         // input parameter
         ArrayList<String> tmp = new ArrayList<String>();
-        for (Iterator<String> iterator = context.getMessageContext("input").getNames();
iterator.hasNext();) {
+        for (Iterator<String> iterator = context.getMessageContext(MessageContext.INPUT_KEY).getNames();
iterator.hasNext();) {
             String key = iterator.next();
-            tmp.add(context.getMessageContext("input").getStringValue(key));
+            tmp.add(context.getMessageContext(MessageContext.INPUT_KEY).getStringValue(key));
         }
         
         List<String> cmdList = new ArrayList<String>();
@@ -228,7 +225,7 @@ public class LocalProvider extends Abstr
             String stdErrStr = GfacUtils.readFile(app.getStdErr());
 
             // set to context
-            OutputUtils.fillOutputFromStdout(context.<AbstractParameter>getMessageContext("output"),
stdOutStr, stdErrStr);
+            OutputUtils.fillOutputFromStdout(context.<AbstractParameter>getMessageContext(MessageContext.OUTPUT_KEY),
stdOutStr, stdErrStr);
 
         } catch (IOException e) {
         	log.error("error", e);

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
Thu Sep  8 00:49:49 2011
@@ -41,6 +41,7 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.commons.gfac.type.app.ShellApplicationDeployment;
 import org.apache.airavata.commons.gfac.type.parameter.AbstractParameter;
 import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
+import org.apache.airavata.core.gfac.context.message.MessageContext;
 import org.apache.airavata.core.gfac.context.security.impl.SSHSecurityContextImpl;
 import org.apache.airavata.core.gfac.exception.GfacException;
 import org.apache.airavata.core.gfac.notification.NotificationService;
@@ -138,9 +139,9 @@ public class SSHProvider extends Abstrac
 
         // input parameter
         ArrayList<String> tmp = new ArrayList<String>();
-        for (Iterator<String> iterator = context.getMessageContext("input").getNames();
iterator.hasNext();) {
+        for (Iterator<String> iterator = context.getMessageContext(MessageContext.INPUT_KEY).getNames();
iterator.hasNext();) {
             String key = iterator.next();
-            tmp.add(context.getMessageContext("input").getStringValue(key));
+            tmp.add(context.getMessageContext(MessageContext.INPUT_KEY).getStringValue(key));
         }
 
         List<String> cmdList = new ArrayList<String>();
@@ -242,10 +243,7 @@ public class SSHProvider extends Abstrac
                 String stdErrStr = GfacUtils.readFile(localStdErrFile.getAbsolutePath());
 
                 // set to context
-
-					 //TODO: "output" should be replaced by a static string or else a specialized
-					 //TODO: message.  See TODO comments from MessageContext.java
-                OutputUtils.fillOutputFromStdout(context.<AbstractParameter>getMessageContext("output"),
stdOutStr, stdErrStr);
+                OutputUtils.fillOutputFromStdout(context.<AbstractParameter>getMessageContext(MessageContext.OUTPUT_KEY),
stdOutStr, stdErrStr);
 
             } catch (Exception e) {
                 throw e;

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
Thu Sep  8 00:49:49 2011
@@ -21,14 +21,12 @@
 
 package org.apache.airavata.core.gfac.provider.utils;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.commons.gfac.type.app.GramApplicationDeployment;
-import org.apache.airavata.commons.gfac.type.host.GlobusHost;
 import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
+import org.apache.airavata.core.gfac.context.message.MessageContext;
 import org.apache.airavata.core.gfac.exception.GfacException;
 import org.apache.airavata.core.gfac.exception.GfacException.FaultCode;
 import org.apache.airavata.core.gfac.utils.GFacConstants;
@@ -44,9 +42,7 @@ public class GramRSLGenerator {
     };
 
     public static GramAttributes configureRemoteJob(InvocationContext context) throws GfacException
{
-        GlobusHost host = (GlobusHost) context.getExecutionDescription().getHost();
         GramApplicationDeployment app = (GramApplicationDeployment) context.getExecutionDescription().getApp();
-        ServiceDescription service = context.getExecutionDescription().getService();
 
         GramAttributes jobAttr = new GramAttributes();
         jobAttr.setExecutable(app.getExecutable());
@@ -84,10 +80,9 @@ public class GramRSLGenerator {
             jobAttr.setStdin(app.getStdIn());
         } else {
             // input parameter
-            ArrayList<String> tmp = new ArrayList<String>();
-            for (Iterator<String> iterator = context.getMessageContext(GFacConstants.MESSAGE_CONTEXT_INPUT_NAME).getNames();
iterator.hasNext();) {
+            for (Iterator<String> iterator = context.getMessageContext(MessageContext.INPUT_KEY).getNames();
iterator.hasNext();) {
                 String key = iterator.next();
-                jobAttr.addArgument(context.getMessageContext(GFacConstants.MESSAGE_CONTEXT_INPUT_NAME).getStringValue(key));
+                jobAttr.addArgument(context.getMessageContext(MessageContext.INPUT_KEY).getStringValue(key));
             }
         }
 

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GFacConstants.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GFacConstants.java?rev=1166482&r1=1166481&r2=1166482&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GFacConstants.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GFacConstants.java
Thu Sep  8 00:49:49 2011
@@ -23,9 +23,6 @@ package org.apache.airavata.core.gfac.ut
 
 public class GFacConstants {
     
-    public static final String MESSAGE_CONTEXT_INPUT_NAME = "input";
-    public static final String MESSAGE_CONTEXT_OUTPUT_NAME = "output";
-
     public static final String INPUT_DATA_DIR_VAR_NAME = "inputData";
 
     public static final String OUTPUT_DATA_DIR_VAR_NAME = "outputData";



Mime
View raw message