22import java.util.concurrent.Callable;
29public abstract class Task implements Callable<Object>
51 public Object
lock =
new Object();
88 protected final String
SEP = System.getProperty(
"file.separator");
93 protected final String
NL = System.getProperty(
"line.separator");
185 System.err.println(
"Calling stop on processes from "
186 + this.getClass().getName() +
" " +
id);
193 Thread.currentThread().interrupt();
207 StringBuilder sb =
new StringBuilder();
208 sb.append(this.getClass().getName());
209 sb.append(
" [id=").append(
id);
211 sb.append(
", completed=").append(
completed).append(
"] ");
212 return sb.toString();
219 this.notifyGlobalTaskManager = notify;
Manager for tasks submitted by the GUI.
static void subtractDoneTask()
A task that can throw exceptions.
boolean notifyGlobalTaskManager
Flag controlling whether this task is expected to notify the static task manager.
String toString()
Returns a string identifying this task by its ID and reporting whether an exception has been thrown a...
void setNotify(boolean notify)
File workDir
The file system location where we want to be placed when doing the work.
int id
A user-assigned id for this task.
boolean completed
Flag about completion.
int verbosity
Verbosity level.
Object lock
Lock for addressing synchronization issues.
ProcessHandler processHandler
Executor for external bash script.
String errMsg
Error message produced by any subtask.
boolean hasException
Flag about exception.
void setVerbosity(int verbosity)
Set the verbosity: i.e., amount of log printed by this class.
final String NL
System-dependent line separator (newline)
void setWorkSpace(File workDir)
Sets the pathname of the work space, i.e., the location where the task is supposed to use move to or ...
void stopTask()
Stop the task if not already completed.
final String SEP
System-dependent file separator.
Throwable thrownExc
Exception thrown.