| Modifier and Type | Field and Description |
|---|---|
| private static final AtomicInteger | |
| private volatile Exception | |
| private volatile boolean | |
| private volatile Object | result
The result, if any. |
| public volatile boolean | stop
A flag indicating the get() method has been called. |
| private Thread |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | |
| public Task | |
| public Task | |
| public Object | Returns: the result, or nullCalling this method will set the stop flag and wait until the thread is stopped. |
| public Exception | |
| public boolean | |
| public void | |
| public void |
| counter | back to summary |
|---|---|
| private static final AtomicInteger counter | |
| ex | back to summary |
|---|---|
| private volatile Exception ex | |
| finished | back to summary |
|---|---|
| private volatile boolean finished | |
| result | back to summary |
|---|---|
| private volatile Object result The result, if any. | |
| stop | back to summary |
|---|---|
| public volatile boolean stop A flag indicating the get() method has been called. | |
| thread | back to summary |
|---|---|
| private Thread thread | |
| Task | back to summary |
|---|---|
| public Task() | |
| call | back to summary |
|---|---|
| public abstract void call() throws Exception The method to be implemented.
| |
| execute | back to summary |
|---|---|
| public Task execute() Start the thread.
| |
| execute | back to summary |
|---|---|
| public Task execute(String threadName) Start the thread. | |
| get | back to summary |
|---|---|
| public Object get() Calling this method will set the stop flag and wait until the thread is stopped.
| |
| getException | back to summary |
|---|---|
| public Exception getException() Get the exception that was thrown in the call (if any).
| |
| isFinished | back to summary |
|---|---|
| public boolean isFinished() Whether the call method has returned (with or without exception).
| |
| join | back to summary |
|---|---|
| public void join() Stop the thread and wait until it is no longer running. Exceptions are ignored. | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |