Package gri.gridp.tasks

Examples of gri.gridp.tasks.RunScriptTask$RequestTaskDef


     * Creates a local JobManager
     */
    protected static JobManager createLocalSystem() {
        String directory = "C:\\Program Files\\GRI\\JServer\\modules";
       
        RunScriptTask runScript = new RunScriptTask("job.bat", "cmd /C job.bat");
        GridpTaskManager taskManager = new GridpTaskManager(
            new File(directory), runScript);
       
        return new BasicJobManager(taskManager);
    }
View Full Code Here


  /**
   * Creates a local TaskManager for GRIDP tasks
   */
  public TaskManager getTaskManager() {
    ModuleManager moduleManager = getModuleManager();
    RunScriptTask runScript = new RunScriptTask(scriptFile, execCmd);
    return new GridpTaskManager(moduleManager, runScript);
  }
View Full Code Here

    elem.addContent(scriptElem);
  }

  public GridpTaskManager readTaskManager(Element elem) throws IOException {
    ModuleManager moduleManager;
    RunScriptTask runScriptTask;

    Element moduleElem = elem.getChild("modules");
    if (moduleElem == null)
      throw new MissingElementException("modules");
    moduleManager = (ModuleManager)moduleManagerSerializer.read(moduleElem);
View Full Code Here

    elem.addContent(deleteWhenFreeElem);
    */
  }

  public RunScriptTask readTask(Element elem) throws IOException {
    RunScriptTask task = new RunScriptTask(null, null);

    List children = elem.getChildren();
    Element child;
    for (int i=0; i<children.size(); i++) {
      child = (Element)children.get(i);
      String name = child.getName();

      if (name.equals("scriptFile"))
        task.setScriptFile(child.getText());
      else if (name.equals("execCommand"))
        task.setExecCommand(child.getText());
      /*
      else if (name.equals("jobFolderFactory")) 
        config.setJobFolderFactory(
            (JobFolderFactory)jobFolderFactorySerializer.read(child)
        );
      else if (name.equals("deleteDirectoryWhenFreed"))
        config.setDeleteDirectoryWhenFreed(
            child.getText().toLowerCase().equals("true")
        );
        */
    }

    //validate:
    if (task.getScriptFile() == null)
      throw new IOException("RunScriptTask missing required 'scriptFile' element");
    if (task.getExecCommand() == null)
      throw new IOException("RunScriptTask missing required 'execCommand' element");

    return task;
  }
View Full Code Here

TOP

Related Classes of gri.gridp.tasks.RunScriptTask$RequestTaskDef

Copyright © 2018 www.massapicom. 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.