[Swift-commit] r6295 - branches/faster/src/org/griphyn/vdl/karajan/lib

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Tue Feb 19 13:50:13 CST 2013


Author: hategan
Date: 2013-02-19 13:50:13 -0600 (Tue, 19 Feb 2013)
New Revision: 6295

Modified:
   branches/faster/src/org/griphyn/vdl/karajan/lib/SiteCatalog.java
Log:
better backwards compatibility with previous site catalog parsing scheme

Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/SiteCatalog.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/SiteCatalog.java	2013-02-19 18:08:55 UTC (rev 6294)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/SiteCatalog.java	2013-02-19 19:50:13 UTC (rev 6295)
@@ -18,6 +18,7 @@
 import org.globus.cog.abstraction.impl.common.task.InvalidProviderException;
 import org.globus.cog.abstraction.impl.common.task.ServiceContactImpl;
 import org.globus.cog.abstraction.impl.common.task.ServiceImpl;
+import org.globus.cog.abstraction.interfaces.ExecutionService;
 import org.globus.cog.abstraction.interfaces.Service;
 import org.globus.cog.abstraction.interfaces.ServiceContact;
 import org.globus.cog.karajan.analyzer.ArgRef;
@@ -162,35 +163,39 @@
         String provider = attr(n, "provider");
         String url = attr(n, "url", null);
         String jobManager = attr(n, "jobManager", null);
+        
+        ExecutionService s = new ExecutionServiceImpl();
+        s.setProvider(provider);
         ServiceContact contact = null;
         if (url != null) {
             contact = new ServiceContactImpl(url);
+            s.setServiceContact(contact);
+            s.setSecurityContext(AbstractionFactory.newSecurityContext(provider, contact));
         }
-        else if (provider.equals("local")) {
-            contact = new ServiceContactImpl("localhost");
+        
+        if (jobManager != null) {
+            s.setJobManager(jobManager);
         }
-        else {
-            throw new IllegalArgumentException("Missing URL");
-        }
-        return new ExecutionServiceImpl(provider, contact, 
-            AbstractionFactory.newSecurityContext(provider, contact), jobManager);
+        
+        return s;
     }
 
     private Service filesystem(Node n) throws InvalidProviderException, ProviderMethodException {
         String provider = attr(n, "provider");
         String url = attr(n, "url", null);
+        
+        Service s = new ServiceImpl();
+        s.setType(Service.FILE_OPERATION);
+        s.setProvider(provider);
+        
         ServiceContact contact = null;
         if (url != null) {
             contact = new ServiceContactImpl(url);
+            s.setServiceContact(contact);
+            s.setSecurityContext(AbstractionFactory.newSecurityContext(provider, contact));
         }
-        else if (provider.equals("local")) {
-            contact = new ServiceContactImpl("localhost");
-        }
-        else {
-            throw new IllegalArgumentException("Missing URL");
-        }
-        return new ServiceImpl(provider, Service.FILE_OPERATION, 
-            contact, AbstractionFactory.newSecurityContext(provider, contact));
+        
+        return s;
     }
 
     private void env(BoundContact bc, Node n) {




More information about the Swift-commit mailing list