Package gri.tasks

Examples of gri.tasks.TaskDef


      outputs.put("result", new Integer(result));
      return outputs;
    }
   
    public TaskDef getTaskDef() {
      TaskDef taskDef = new TaskDef();
      taskDef.addInput(new ParameterDef("x", Types.INTEGER));
      taskDef.addInput(new ParameterDef("y", Types.INTEGER));
      taskDef.addOutput(new ParameterDef("result", Types.INTEGER));
      return taskDef;
    }
View Full Code Here


   
    /**
     * Returns the task definition for this task
     */
    public TaskDef getTaskDefinition() {
        TaskDef def = new TaskDef();
       
        //construtor
        if (hasConstructor()) {
            ParameterDef [] params = constructorDef.getParameterDefs();
            for(int i=0; i<params.length; i++)
                def.addInput(params[i]);
        }
       
        //properties
        if (hasPropertyBinding()) {
            ParameterDef [] inputs = propertyDef.listInputDefinitions();
            for (int i=0; i<inputs.length; i++)
                def.addInput(inputs[i]);
           
            ParameterDef [] outputs = propertyDef.listOutputDefinitions();
            for (int i=0; i<outputs.length; i++)
                def.addOutput(outputs[i]);
        }
       
        //method
        ParameterDef [] params = targetMethodDef.getParameterDefs();
        for(int i=0; i<params.length; i++)
            def.addInput(params[i]);
           
        ParameterDef returnType = targetMethodDef.getReturnType();
        if (returnType != null)
            def.addOutput(returnType);
       
        return def;
    }
View Full Code Here

   
    /**
     * Returns a ParameterizedTaskDef that defines the method
     */
    public TaskDef toTaskDef() {
        TaskDef def = new TaskDef();
       
        for(int i=0; i<params.length; i++)
            def.addInput(params[i]);
        if (this.returnType != null)
            def.addOutput(returnType);
       
        return def;
    }
View Full Code Here

    System.out.println("Name: " + taskDesc.getName());
    System.out.println("Description: " + taskDesc.getDescription());
    System.out.println();
   
    //parameters:
    TaskDef taskDef = taskManager.getTaskDefinition(id);
    System.out.println(taskDef);
  }
View Full Code Here

   */
  protected void validateInputs(Map outputs) throws Exception {
    //get/validate inputs:
    Map inputs = this.inputPanel.getValues();

    TaskDef taskDef = taskInfo.getTaskDefinition();
    List inputDefs = taskDef.getInputs();
    Iterator iInputDefs = inputDefs.iterator();
    while (iInputDefs.hasNext()) {
      ParameterDef inputDef = (ParameterDef)iInputDefs.next();
      String paramName = inputDef.getName();
      if (inputDef.isRequired() && inputs.get(paramName) == null)
View Full Code Here

    System.out.println("Name: " + taskDesc.getName());
    System.out.println("Description: " + taskDesc.getDescription());
    System.out.println();
   
    //parameters:
    TaskDef taskDef = taskManager.getTaskDefinition(id);
    System.out.println(taskDef);
  }
View Full Code Here

        System.out.println("  " + taskIds[i]);
      System.out.println();
    }
   
    else if (mode == DESCRIBE_TASK) {
      TaskDef taskDef = taskManager.getTaskDefinition(moduleName);
      System.out.println(taskDef);
    }
   
    else if (mode == RUN_TASK) {
     
View Full Code Here

    }
   
    // ---------------------------------------------------------- TaskSerializer
    
    public TaskSerializerSet getTaskSerializerSet(TaskInfoManager taskManager, String taskId) {
  TaskDef taskDef = taskManager.getTaskDefinition(taskId);
  return new BasicTaskSerializerSet(taskDef, psFactory, this);
    }
View Full Code Here

    }

    public TaskDef getTaskDefinition(String taskId) {
        //try to find cached definition:
        if (cacheInfo) {
            TaskDef definition = (TaskDef)taskDefinitions.get(taskId);
            if (definition != null)
                return definition;
        }
       
        //obtain definition from service:
        try {
            String xml = service.getTaskDefinition(taskId);
            Document doc = buildXML(xml);
            TaskDef definition = serializers.getTaskDefinitionSerializer()
                                                         .readTaskDef(doc.getRootElement());
           
            if (cacheInfo)
                taskDefinitions.put(taskId, definition);
           
View Full Code Here

                   .write(description, elem);
        return serviceUtil.writeXML(elem);
    }
   
    public String getTaskDefinition(String taskId) throws IOException {
        TaskDef taskDef = getJobManager().getTaskDefinition(taskId);
       
        Element elem = new Element("definition");
        serializers.getTaskDefinitionSerializer()
                   .write(taskDef, elem);
        return serviceUtil.writeXML(elem);
View Full Code Here

TOP

Related Classes of gri.tasks.TaskDef

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.