This class is effectively a superset of
org.apache.tools.ant.taskdefs.Parallel.TaskRunnable
| Modifier and Type | Field and Description |
|---|---|
| private volatile BuildException | |
| public static final String | ERROR_NO_TASK
Error message if invoked with no task |
| private volatile Throwable | |
| private volatile boolean | |
| private Object | |
| private Task |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private synchronized void | |
| public synchronized BuildException | |
| public synchronized Throwable | Returns: the exception.Get whatever was thrown, which may or may not be a buildException. |
| public Task | |
| public synchronized boolean | |
| public void | |
| public void | run()
Overrides java. Implements java. |
| public void | waitUntilFinished(long
timeout in milliseconds timeout)Block on the notify object and so wait until the thread is finished. |
| buildException | back to summary |
|---|---|
| private volatile BuildException buildException | |
| ERROR_NO_TASK | back to summary |
|---|---|
| public static final String ERROR_NO_TASK Error message if invoked with no task | |
| exception | back to summary |
|---|---|
| private volatile Throwable exception | |
| finished | back to summary |
|---|---|
| private volatile boolean finished | |
| notify | back to summary |
|---|---|
| private Object notify | |
| task | back to summary |
|---|---|
| private Task task | |
| WorkerAnt | back to summary |
|---|---|
| public WorkerAnt(Task task, Object notify) Create the worker. This does not start the thread, merely configures it. | |
| WorkerAnt | back to summary |
|---|---|
| public WorkerAnt(Task task) Create the worker, using the worker as the notification point. This does not start the thread, merely configures it.
| |
| caught | back to summary |
|---|---|
| private synchronized void caught(Throwable thrown) Handle a caught exception, by recording it and possibly wrapping it in a BuildException for later rethrowing.
| |
| getBuildException | back to summary |
|---|---|
| public synchronized BuildException getBuildException() Get any build exception. This would seem to be oversynchronised, but know that Java pre-1.5 can reorder volatile access. The synchronized attribute is to force an ordering.
| |
| getException | back to summary |
|---|---|
| public synchronized Throwable getException() Get whatever was thrown, which may or may not be a buildException. Assertion: getException() instanceof BuildException <=> getBuildException()==getException()
| |
| getTask | back to summary |
|---|---|
| public Task getTask() Get the task
| |
| isFinished | back to summary |
|---|---|
| public synchronized boolean isFinished() Query the task/thread for being finished. This would seem to be oversynchronised, but know that Java pre-1.5 can reorder volatile access. The synchronized attribute is to force an ordering.
| |
| rethrowAnyBuildException | back to summary |
|---|---|
| public void rethrowAnyBuildException() Raise an exception if one was caught
| |
| run | back to summary |
|---|---|
| public void run() Overrides java. Implements java. Run the task, which is skipped if null. When invoked again, the task is re-run. | |
| waitUntilFinished | back to summary |
|---|---|
| public void waitUntilFinished(long timeout) throws InterruptedException Block on the notify object and so wait until the thread is finished.
| |