[Swift-commit] r3222 - trunk/src/org/griphyn/vdl/karajan

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Feb 3 16:23:18 CST 2010


Author: wozniak
Date: 2010-02-03 16:23:18 -0600 (Wed, 03 Feb 2010)
New Revision: 3222

Modified:
   trunk/src/org/griphyn/vdl/karajan/Loader.java
Log:
Should have been included in r3221


Modified: trunk/src/org/griphyn/vdl/karajan/Loader.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/Loader.java	2010-02-03 21:12:49 UTC (rev 3221)
+++ trunk/src/org/griphyn/vdl/karajan/Loader.java	2010-02-03 22:23:18 UTC (rev 3222)
@@ -38,6 +38,7 @@
 import org.globus.cog.karajan.workflow.service.channels.AbstractKarajanChannel;
 import org.globus.cog.util.ArgumentParser;
 import org.globus.cog.util.ArgumentParserException;
+import org.globus.swift.data.Director;
 import org.griphyn.vdl.engine.Karajan;
 import org.griphyn.vdl.karajan.functions.ConfigProperty;
 import org.griphyn.vdl.karajan.lib.Execute;
@@ -64,6 +65,7 @@
     public static final String ARG_VERBOSE = "verbose";
     public static final String ARG_DEBUG = "debug";
     public static final String ARG_LOGFILE = "logfile";
+    public static final String ARG_CDMFILE = "cdm.file";
     public static final String ARG_RUNID = "runid";
     public static final String ARG_TUI = "tui";
     public static final String ARG_RECOMPILE = "recompile";
@@ -90,6 +92,9 @@
             if (ap.isPresent(ARG_MONITOR)) {
                 new Monitor().start();
             }
+            if (ap.isPresent(ARG_CDMFILE)) {
+                loadCDM(ap); 
+            }
             if (!ap.hasValue(ArgumentParser.DEFAULT)) {
                 error("No SwiftScript program specified");
             }
@@ -209,6 +214,20 @@
         System.err.print("For usage information:  swift -help\n\n");
     }
     
+    static void loadCDM(ArgumentParser ap) {
+        String cdmString = null;
+        try { 
+            cdmString = ap.getStringValue(ARG_CDMFILE);
+            File cdmFile = new File(cdmString); 
+            Director.load(cdmFile); 
+        }
+        catch (IOException e) { 
+            logger.debug("Detailed exception:", e);
+            error("Could not start execution.\n\t" +
+                  "Could not read given CDM policy file: " + cdmString);
+        }
+    }
+    
     public static String compile(String project) throws FileNotFoundException,
             ParsingException, IncorrectInvocationException,
             CompilationException, IOException {
@@ -396,6 +415,11 @@
                         + "uses the name of the SwiftScript program being run and additional information to make the name unique.",
                 "file", ArgumentParser.OPTIONAL);
         ap
+        .addOption(
+            ARG_CDMFILE,
+            "Specifies a CDM policy file.",
+            "file", ArgumentParser.OPTIONAL);
+        ap
             .addOption(
                 ARG_RUNID,
                 "Specifies the run identifier. This must be unique for every invocation of a workflow and is used in several places to keep files from different executions cleanly separated. By default, a datestamp and random number are used to generate a run identifier.",




More information about the Swift-commit mailing list