
ValueType - The type of the value to wrappublic class ParallelFuture<ValueType> extends Object implements HjFuture<ValueType>
| Modifier and Type | Class and Description |
|---|---|
static class |
ParallelFuture.EventType |
static class |
ParallelFuture.ExecutionState |
HjFuture.CancelledException| Modifier | Constructor and Description |
|---|---|
protected |
ParallelFuture()
No-args Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
attachListener(PropertyChangeListener changeListener)
attachListener.
|
boolean |
cancel()
Attempts to cancel execution of this task.
|
static <ValueType> |
factory()
Factory method.
|
boolean |
failed()
Return true if there was an exception while computing the value.
|
void |
failed(Exception ex)
Notifies that there was an exception while computing the result of the future.
|
ValueType |
get()
Returns the value wrapped in the future.
|
protected boolean |
isCancelled() |
protected boolean |
markStart() |
protected Runnable |
preReleaseCallback() |
void |
put(ValueType newValue)
Associates the specified value with the HjFuture.
|
boolean |
resolved()
Returns whether the future has been resolved, i.e. the value has been computed.
|
protected ValueType |
retrieveValue() |
ValueType |
safeGet()
Returns the value wrapped in the Future.
|
protected void |
throwPutFailedException(ValueType newValue)
throwPutFailedException.
|
public static <ValueType> ParallelFuture<ValueType> factory()
ValueType - The type of the value to wrapprotected final void attachListener(PropertyChangeListener changeListener)
attachListener.
changeListener - The listener to attach to the future.
The listener may be synchronously triggered.public boolean cancel()
protected boolean isCancelled()
protected boolean markStart()
public final void put(ValueType newValue)
newValue - The value to store into the future.public final void failed(Exception ex)
Exception as the reason of failure while
computing the result of the HjFuture.
This operation may fail if the single assignment property is violated.ex - The exception while computing the result of the futureprotected void throwPutFailedException(ValueType newValue)
throwPutFailedException.
newValue - The value attempted to put into the futurepublic ValueType get() throws SuspendableException
If the future task has not completed as yet, the task performing the get() operation blocks until the result of the future becomes available.
get in interface HjFuture<ValueType>SuspendableExceptionpublic ValueType safeGet()
It is illegal to perform a safeGet() operation on an empty Future (i.e. one that has not yet been resolved).
protected Runnable preReleaseCallback()
protected ValueType retrieveValue()
public final boolean resolved()
Copyright © 2014 Rice University - Department of Computer Science. All rights reserved.