|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.client.concurrent.JPPFTaskFuture<V>
V - the type of the result for the future.public class JPPFTaskFuture<V>
Implementation of a future handled by a JPPFExecutorService.
| Field Summary | |
|---|---|
protected AtomicBoolean |
cancelled
The cancellation status of the task represented by this future. |
protected AtomicBoolean |
done
The completion status of the task represented by this future. |
protected Exception |
exception
An exception that may be rasied by the execution of the task. |
protected V |
result
The execution result. |
protected AtomicBoolean |
timedout
TDetrmines whether the task execution timed out. |
| Constructor Summary | |
|---|---|
JPPFTaskFuture(org.jppf.client.concurrent.FutureResultCollector collector,
int position)
Initialize this future with the specified parameters. |
|
| Method Summary | |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
Attempts to cancel execution of this task. |
V |
get()
Waits if necessary for the computation to complete, and then retrieves its result. |
V |
get(long timeout,
TimeUnit unit)
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. |
JPPFTask |
getTask()
Get the task associated with this future. |
boolean |
isCancelled()
Determine whether this task was cancelled before it completed normally. |
boolean |
isDone()
Returns true if this task completed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AtomicBoolean done
protected AtomicBoolean cancelled
protected AtomicBoolean timedout
protected V result
protected Exception exception
| Constructor Detail |
|---|
public JPPFTaskFuture(org.jppf.client.concurrent.FutureResultCollector collector,
int position)
collector - the collector that receives the results from the server.position - the position of the task in the job.| Method Detail |
|---|
public boolean isDone()
isDone in interface Future<V>AbstractJPPFFuture.isDone()
public V get()
throws InterruptedException,
ExecutionException
get in interface Future<V>InterruptedException - if the current thread was interrupted while waiting.
ExecutionException - if the computation threw an exception.Future.get()
public V get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
get in interface Future<V>timeout - the maximum time to wait.unit - the time unit of the timeout argument.
InterruptedException - if the current thread was interrupted while waiting.
ExecutionException - if the computation threw an exception.
TimeoutException - if the wait timed out.Future.get(long, java.util.concurrent.TimeUnit)public JPPFTask getTask()
JPPFTask instance.public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface Future<V>mayInterruptIfRunning - true if the thread executing this task should be interrupted;
otherwise, in-progress tasks are allowed to complete.
Future.cancel(boolean)public boolean isCancelled()
isCancelled in interface Future<V>Future.isCancelled()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||