java.lang.Runnable
public class WorkerAnt
extends java.lang.Thread
This class is effectively a superset of
org.apache.tools.ant.taskdefs.Parallel.TaskRunnable
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
ERROR_NO_TASK |
Error message if invoked with no task
|
Constructor | Description |
---|---|
WorkerAnt(Task task) |
Create the worker, using the worker as the notification point.
|
WorkerAnt(Task task,
java.lang.Object notify) |
Create the worker.
|
Modifier and Type | Method | Description |
---|---|---|
BuildException |
getBuildException() |
Get any build exception.
|
java.lang.Throwable |
getException() |
Get whatever was thrown, which may or may not be a buildException.
|
Task |
getTask() |
Get the task
|
boolean |
isFinished() |
Query the task/thread for being finished.
|
void |
rethrowAnyBuildException() |
Raise an exception if one was caught
|
void |
run() |
Run the task, which is skipped if null.
|
void |
waitUntilFinished(long timeout) |
Block on the notify object and so wait until the thread is finished.
|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public static final java.lang.String ERROR_NO_TASK
public WorkerAnt(Task task, java.lang.Object notify)
This does not start the thread, merely configures it.
task
- the tasknotify
- what to notifypublic WorkerAnt(Task task)
This does not start the thread, merely configures it.
task
- the taskpublic BuildException getBuildException()
public java.lang.Throwable getException()
public Task getTask()
public boolean isFinished()
public void waitUntilFinished(long timeout) throws java.lang.InterruptedException
timeout
- timeout in millisecondsjava.lang.InterruptedException
- if the execution was interruptedpublic void rethrowAnyBuildException()
BuildException
- if one has been picked uppublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread