public abstract class MultiTaskJob<TaskKey,TaskResult,Result> extends Job
Job.Inform, Job.Key, Job.Priority, Job.Type
endTime, finished, LOCALDEBUGFLAG, MIN_NUM_SECONDS, reportExecution, startTime
Constructor and Description |
---|
MultiTaskJob(java.lang.String jobName,
Tool t,
Job.Type jobType,
Consumer<Result> c)
Constructor creates a new instance of MultiTaskJob.
|
Modifier and Type | Method and Description |
---|---|
boolean |
doIt()
This method is not overriden by subclasses.
|
abstract Result |
mergeTaskResults(java.util.Map<TaskKey,TaskResult> taskResults)
This abtract method combines task results into final result.
|
abstract void |
prepareTasks()
This abstract method split large computation into smaller task.
|
abstract TaskResult |
runTask(TaskKey taskKey)
This abtract methods performs computation of each task.
|
void |
startTask(java.lang.String taskName,
TaskKey taskKey)
Schedules task.
|
abort, checkAbort, fieldVariableChanged, getAllJobs, getDatabase, getDebug, getDeleteWhenDone, getEditingPreferences, getEnvironment, getExtendedUserInterface, getInfo, getInform, getKey, getRunningJob, getScheduledToAbort, getStatus, getTechPool, getTool, getUserInterface, initJobManager, inServerThread, isClientThread, isFinished, pipeClient, pipeServer, remove, setCurrentLibraryInJob, setDebug, setProgress, setReportExecutionFlag, socketClient, startJob, startJob, startJobOnMyResult, terminateFail, terminateIt, terminateOK, toString, updateIncrementalDRCErrors, updateNetworkErrors
public MultiTaskJob(java.lang.String jobName, Tool t, Job.Type jobType, Consumer<Result> c)
jobName
- a string that describes this MultiTaskJob.t
- the Tool that originated this MultiTaskJob.jobType
- the Type of this Job (SERVER_EXAMINE or CHANGE).c
- interface which consumes the result on serverpublic abstract void prepareTasks() throws JobException
JobException
public abstract TaskResult runTask(TaskKey taskKey) throws JobException
taskKey
- task key which identifies the taskJobException
public abstract Result mergeTaskResults(java.util.Map<TaskKey,TaskResult> taskResults) throws JobException
taskResults
- map which contains result of each completed task.JobException
public void startTask(java.lang.String taskName, TaskKey taskKey)
taskName
- task name which is appeared in Jobs Explorer TreetaskKey
- task key which identifies the task.public final boolean doIt() throws JobException
doIt
in class Job
JobException