com.massimo.tools.scriptrunner.control
Class SpawnTask

java.lang.Object
  extended by com.massimo.tools.scriptrunner.AbstractTask
      extended by com.massimo.tools.scriptrunner.control.AbstractCompoundTask
          extended by com.massimo.tools.scriptrunner.control.SpawnTask
All Implemented Interfaces:
Task

public class SpawnTask
extends AbstractCompoundTask

A Task to spawn a Thread in which to process the single child Task.
This Task does not wait for the child to finish but returns success immediately.


Field Summary
 
Fields inherited from class com.massimo.tools.scriptrunner.AbstractTask
definition, name, parent, properties, type
 
Fields inherited from interface com.massimo.tools.scriptrunner.Task
DATA_ERROR, ERROR, FINISHED, INTERRUPTED, PROMPT, RUNNING, START, SUCCESS
 
Constructor Summary
SpawnTask(Task parent, String type, Element definition, Map<String,String> contextProperties)
           
 
Method Summary
protected  org.apache.log4j.Logger getLogger()
          
protected  int processCompound(ExecutionContext context, Elements tasks)
          Process any and all child tasks.
 
Methods inherited from class com.massimo.tools.scriptrunner.control.AbstractCompoundTask
addChild, doProcess, doValidate, getChildren, interrupt
 
Methods inherited from class com.massimo.tools.scriptrunner.AbstractTask
getBooleanProperty, getCurrentWorkingDirectory, getDefinition, getIntProperty, getName, getParent, getProperties, getStartProcessingRow, getText, getType, isIgnoreableError, isIgnoreableError, isInterrupted, isLogProgress, postProcess, preProcess, process, resultCodeToString, substituteParameters, toString, validate, validateConnections, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpawnTask

public SpawnTask(Task parent,
                 String type,
                 Element definition,
                 Map<String,String> contextProperties)
Parameters:
parent -
type -
definition -
contextProperties -
Method Detail

getLogger

protected org.apache.log4j.Logger getLogger()

Specified by:
getLogger in class AbstractTask
Returns:
Class logger

processCompound

protected int processCompound(ExecutionContext context,
                              Elements tasks)
                       throws Exception
Process any and all child tasks. Created Tasks should be added to children using addChild(Task) Executes the child Task in a separate thread. Does not wait for it to finish but returns success immediately.

Specified by:
processCompound in class AbstractCompoundTask
Parameters:
context -
tasks - A list of Task definition Elements
Returns:
The result of running all tasks
Throws:
Exception