com.massimo.tools.scriptrunner.work
Class ThreadedSQLTask

java.lang.Object
  extended by com.massimo.tools.scriptrunner.AbstractTask
      extended by com.massimo.tools.scriptrunner.work.SQLTask
          extended by com.massimo.tools.scriptrunner.work.ThreadedSQLTask
All Implemented Interfaces:
Task

public class ThreadedSQLTask
extends SQLTask

Execute SQL statements in a number of threads.
Introduces attribute Constants.ATTRIBUTE_THREAD_COUNT.


Field Summary
protected  Thread[] threads
           
 
Fields inherited from class com.massimo.tools.scriptrunner.work.SQLTask
BIND_END_DELIMITERS, bindNames, connection, dbType, run_id, SQL_CHECK_PREFIX_ORACLE, SQL_CHECK_PREFIX_POSTGRES, SQL_CHECK_SUFFIX_ORACLE, SQL_CHECK_SUFFIX_POSTGRES, SQL_NON_COMMENT_PATTERN, SQL_STMT_PATTERN_ORACLE, SQL_STMT_PATTERN_POSTGRES
 
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
ThreadedSQLTask(Task parent, String type, Element definition, Map<String,String> parentConnectionProperties)
           
 
Method Summary
 int doProcess(ExecutionContext context)
          Implementing classes only need to do their own work and log progress when appropriate.
 int doValidate(ValidationContext context)
          Check whether this task should be able to run.
 
Methods inherited from class com.massimo.tools.scriptrunner.work.SQLTask
executeSQL, finalize, getBindNames, getLogger, getSQLSplitPattern, getSQLText, getSQLWarning, parseTextIntoStatements, postCheck, preCheck, setBinds, substitiuteBinds, validateBinds, validateSQL
 
Methods inherited from class com.massimo.tools.scriptrunner.AbstractTask
getBooleanProperty, getCurrentWorkingDirectory, getDefinition, getIntProperty, getName, getParent, getProperties, getStartProcessingRow, getText, getType, interrupt, isIgnoreableError, isIgnoreableError, isInterrupted, isLogProgress, postProcess, preProcess, process, resultCodeToString, substituteParameters, toString, validate, validateConnections, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

threads

protected Thread[] threads
Constructor Detail

ThreadedSQLTask

public ThreadedSQLTask(Task parent,
                       String type,
                       Element definition,
                       Map<String,String> parentConnectionProperties)
                throws Exception
Parameters:
parent -
type -
definition -
parentConnectionProperties -
Throws:
Exception
Method Detail

doProcess

public int doProcess(ExecutionContext context)
              throws Exception
Implementing classes only need to do their own work and log progress when appropriate.

Overrides:
doProcess in class SQLTask
Returns:
O for success. Anything else is a failure.
Throws:
Exception
See Also:
AbstractTask.process(ExecutionContext)

doValidate

public int doValidate(ValidationContext context)
Check whether this task should be able to run. Implementations should check for the prescence of files, attributes,...

Overrides:
doValidate in class SQLTask
Returns:
O for success. Anything else is a failure.