Examples of ScriptFile


Examples of com.subgraph.vega.impl.scanner.modules.scripting.ScriptFile

  }
 
  public void load() {
    allModules.clear();
    for(URL scriptURL: allTestScripts()) {
      ScriptedModule compiledModule = compileModule(new ScriptFile(scriptURL));
      if(compiledModule != null && !compiledModule.isDisabled())
        allModules.add(compiledModule);
    }
  }
View Full Code Here

Examples of dovetaildb.dbrepository.StandardDbRepository.ScriptFile

      }
    }
    return engine;
  }
  Object ingestScript(String filename, String code, Map<String,Object> env) {
    ScriptFile file = new ScriptFile(code);
    ScriptEngine engine = getScriptEngine(file.language);
    try {
      if (env != null) {
        Bindings bindings = engine.createBindings();
        for(Map.Entry<String,Object> entry : globals.entrySet()) {
View Full Code Here

Examples of org.apache.oodt.cas.workflow.util.ScriptFile

   }

   protected ScriptFile buildPgeRunScript() {
      logger.fine("Creating PGE run script for shell [" + pgeConfig.getShellType()
                  + "] with contents " + pgeConfig.getExeCmds());
      ScriptFile sf = new ScriptFile(pgeConfig.getShellType());
      sf.setCommands(pgeConfig.getExeCmds());
      return sf;
   }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.util.ScriptFile

      logger.fine("Generated script file name [" + pgeScriptName + "]");
      return pgeScriptName;
   }

   protected void runPge() throws Exception {
      ScriptFile sf = null;
      try {
         long startTime = System.currentTimeMillis();
         logger.info("PGE start time [" + new Date(startTime) + "]");

         // create script to run
         sf = buildPgeRunScript();
         sf.writeScriptFile(getScriptPath().getAbsolutePath());

         // run script and evaluate whether success or failure
         updateStatus(RUNNING_PGE.getWorkflowStatusName());
         logger.info("Starting execution of PGE...");
         if (!wasPgeSuccessful(ExecUtils.callProgram(
               pgeConfig.getShellType() + " " + getScriptPath(), logger,
               new File(pgeConfig.getExeDir()).getAbsoluteFile()))) {
            throw new RuntimeException("Pge didn't finish successfully");
         } else {
            logger.info(
                  "Successfully completed running: '" + sf.getCommands() + "'");
         }

         long endTime = System.currentTimeMillis();
         logger.info("PGE end time [" + new Date(startTime) + "]");

         long runTime = endTime - startTime;
         logger.info("PGE runtime in millis [" + runTime + "]");

         pgeMetadata.replaceMetadata(PGE_RUNTIME, Long.toString(runTime));

      } catch (Exception e) {
         throw new Exception("Exception when executing PGE commands '"
               + (sf != null ? sf.getCommands() : "NULL") + "' : "
               + e.getMessage(), e);
      }
   }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.util.ScriptFile

    new SerializableMetadata(metadata, "UTF-8", false)
        .writeMetadataToXmlStream(new FileOutputStream(toMetFilePath));
  }

    protected ScriptFile buildPgeRunScript() {
        ScriptFile sf = new ScriptFile(this.pgeConfig.getShellType());
        sf.setCommands(this.pgeConfig.getExeCmds());
        return sf;
    }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.util.ScriptFile

        handler.close();
      }
    }
   
    protected void runPge() throws Exception {
        ScriptFile sf = null;
        Handler handler = null;
        Logger pgeLogger = null;
        try {
            long startTime = System.currentTimeMillis();

            // create script to run
            sf = this.buildPgeRunScript();
            sf.writeScriptFile(this.getScriptPath());

            // run script and evaluate whether success or failure
            handler = this.initializePgeLogHandler();
            pgeLogger = this.initializePgeLogger(handler);
            this.updateStatus(PgeTaskMetadataKeys.RUNNING_PGE);
            if (!this.wasPgeSuccessful(ExecUtils.callProgram(this.pgeConfig
                    .getShellType()
                    + " " + this.getScriptPath(), pgeLogger, new File(this.pgeConfig
                    .getExeDir()).getAbsoluteFile())))
                throw new RuntimeException("Pge didn't finish successfully");
            else
                LOG.log(Level.INFO, "Successfully completed running: '"
                        + sf.getCommands() + "'");
          
           
            long endTime = System.currentTimeMillis();
            this.pgeMetadata.addCustomMetadata(PgeTaskMetadataKeys.PGE_RUNTIME,
                    (endTime - startTime) + "");

        } catch (Exception e) {
            e.printStackTrace();
            throw new Exception("Exception when executing PGE commands '"
                    + (sf != null ? sf.getCommands() : "NULL") + "' : "
                    + e.getMessage());
        }finally {
          this.closePgeLogHandler(pgeLogger, handler);
        }
    }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.util.ScriptFile

   }

   protected ScriptFile buildPgeRunScript() {
      logger.fine("Creating PGE run script for shell [" + pgeConfig.getShellType()
                  + "] with contents " + pgeConfig.getExeCmds());
      ScriptFile sf = new ScriptFile(pgeConfig.getShellType());
      sf.setCommands(pgeConfig.getExeCmds());
      return sf;
   }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.util.ScriptFile

      logger.fine("Generated script file name [" + pgeScriptName + "]");
      return pgeScriptName;
   }

   protected void runPge() throws Exception {
      ScriptFile sf = null;
      try {
         long startTime = System.currentTimeMillis();
         logger.info("PGE start time [" + new Date(startTime) + "]");

         // create script to run
         sf = buildPgeRunScript();
         sf.writeScriptFile(getScriptPath().getAbsolutePath());

         // run script and evaluate whether success or failure
         updateStatus(RUNNING_PGE.getWorkflowStatusName());
         logger.info("Starting execution of PGE...");
         if (!wasPgeSuccessful(ExecUtils.callProgram(
               pgeConfig.getShellType() + " " + getScriptPath(), logger,
               new File(pgeConfig.getExeDir()).getAbsoluteFile()))) {
            throw new RuntimeException("Pge didn't finish successfully");
         } else {
            logger.info(
                  "Successfully completed running: '" + sf.getCommands() + "'");
         }

         long endTime = System.currentTimeMillis();
         logger.info("PGE end time [" + new Date(startTime) + "]");

         long runTime = endTime - startTime;
         logger.info("PGE runtime in millis [" + runTime + "]");

         pgeMetadata.replaceMetadata(PGE_RUNTIME, Long.toString(runTime));

      } catch (Exception e) {
         throw new Exception("Exception when executing PGE commands '"
               + (sf != null ? sf.getCommands() : "NULL") + "' : "
               + e.getMessage(), e);
      }
   }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.util.ScriptFile

   }

   protected ScriptFile buildPgeRunScript() {
      logger.fine("Creating PGE run script for shell [" + pgeConfig.getShellType()
                  + "] with contents " + pgeConfig.getExeCmds());
      ScriptFile sf = new ScriptFile(pgeConfig.getShellType());
      sf.setCommands(pgeConfig.getExeCmds());
      return sf;
   }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.util.ScriptFile

      logger.fine("Generated script file name [" + pgeScriptName + "]");
      return pgeScriptName;
   }

   protected void runPge() throws Exception {
      ScriptFile sf = null;
      try {
         long startTime = System.currentTimeMillis();
         logger.info("PGE start time [" + new Date(startTime) + "]");

         // create script to run
         sf = buildPgeRunScript();
         sf.writeScriptFile(getScriptPath().getAbsolutePath());

         // run script and evaluate whether success or failure
         updateStatus(RUNNING_PGE.getWorkflowStatusName());
         logger.info("Starting execution of PGE...");
         if (!wasPgeSuccessful(ExecUtils.callProgram(
               pgeConfig.getShellType() + " " + getScriptPath(), logger,
               new File(pgeConfig.getExeDir()).getAbsoluteFile()))) {
            throw new RuntimeException("Pge didn't finish successfully");
         } else {
            logger.info(
                  "Successfully completed running: '" + sf.getCommands() + "'");
         }

         long endTime = System.currentTimeMillis();
         logger.info("PGE end time [" + new Date(startTime) + "]");

         long runTime = endTime - startTime;
         logger.info("PGE runtime in millis [" + runTime + "]");

         pgeMetadata.replaceMetadata(PGE_RUNTIME, Long.toString(runTime));

      } catch (Exception e) {
         throw new Exception("Exception when executing PGE commands '"
               + (sf != null ? sf.getCommands() : "NULL") + "' : "
               + e.getMessage(), e);
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.