public class SingleOperationListenableFuture<ResultType> extends SingleOperationFuture<ResultType> implements IListenableFuture<ResultType>
Listenable future implementation for a single operation.
Subclasses may be created if desired. Note that if subclasses are created, that they should/must be very careful with respect to overriding the synchronized methods in this class.
| Constructor and Description |
|---|
SingleOperationListenableFuture() |
SingleOperationListenableFuture(IProgressMonitor progressMonitor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IExecutor executor,
IProgressRunnable<ResultType> progressRunnable,
IProgressMonitor monitor)
Add an
IProgressRunnable that will be called back/run once the
asynchronous execution is complete. |
void |
runWithProgress(IProgressRunnable<?> runnable)
This method is not intended to be called by clients.
|
cancel, get, get, getProgressMonitor, getStatus, hasValue, isCanceled, isDone, set, setExceptionpublic SingleOperationListenableFuture()
public SingleOperationListenableFuture(IProgressMonitor progressMonitor)
public void addListener(IExecutor executor, IProgressRunnable<ResultType> progressRunnable, IProgressMonitor monitor)
IListenableFutureIProgressRunnable that will be called back/run once the
asynchronous execution is complete. The IProgressRunnable must be
non-null and the IExecutor must also be non-
null. The given progressMonitor may be null.
If the future has already completed by the time this method is called
(i.e. IFuture.isDone() returns true, the progressRunnable
will be executed immediately by the given executor.
addListener in interface IListenableFuture<ResultType>executor - the IExecutor to use to execute the given
IProgressRunnable. Must not be null.progressRunnable - the IProgressRunnable that will be executed when this
future is complete. Must not be null.monitor - an optional progress monitor to be passed to the
progressRunnable when executed. May be null.public void runWithProgress(IProgressRunnable<?> runnable)
SingleOperationFutureIExecutors.runWithProgress in interface ISafeProgressRunnerrunWithProgress in class SingleOperationFuture<ResultType>