public class GridFinishedFuture<T> extends Object implements IgniteInternalFuture<T>
| Constructor and Description |
|---|
GridFinishedFuture()
Creates finished future with complete value.
|
GridFinishedFuture(T t)
Creates finished future with complete value.
|
GridFinishedFuture(Throwable err) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Cancels this future.
|
<R> IgniteInternalFuture<R> |
chain(IgniteClosure<? super IgniteInternalFuture<T>,R> doneCb)
Make a chained future to convert result of this future (when complete) into a new format.
|
<T1> IgniteInternalFuture<T1> |
chain(IgniteClosure<? super IgniteInternalFuture<T>,T1> doneCb,
Executor exec)
Make a chained future to convert result of this future (when complete) into a new format.
|
<R> IgniteInternalFuture<R> |
chainCompose(IgniteClosure<? super IgniteInternalFuture<T>,IgniteInternalFuture<R>> doneCb)
Make a chained future that is completed when
doneCb is executed. |
<R> IgniteInternalFuture<R> |
chainCompose(IgniteClosure<? super IgniteInternalFuture<T>,IgniteInternalFuture<R>> doneCb,
@Nullable Executor exec)
Make a chained future that is completed when
doneCb is executed. |
Throwable |
error() |
T |
get()
Synchronously waits for completion of the computation and
returns computation result.
|
T |
get(long timeout)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
T |
get(long timeout,
TimeUnit unit)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
T |
getUninterruptibly()
Synchronously waits for completion of the computation and returns computation result ignoring interrupts.
|
boolean |
isCancelled()
Returns
true if this computation was cancelled before it completed normally. |
boolean |
isDone()
Checks if computation is done.
|
void |
listen(IgniteInClosure<? super IgniteInternalFuture<T>> lsnr)
Registers listener closure to be asynchronously notified whenever future completes.
|
T |
result() |
String |
toString() |
public GridFinishedFuture()
public GridFinishedFuture(T t)
t - Finished value.public GridFinishedFuture(Throwable err)
err - Future error.public Throwable error()
error in interface IgniteInternalFuture<T>public T result()
result in interface IgniteInternalFuture<T>public boolean cancel()
cancel in interface IgniteInternalFuture<T>True if future was canceled (i.e. was not finished prior to this call).public boolean isCancelled()
true if this computation was cancelled before it completed normally.isCancelled in interface IgniteInternalFuture<T>True if this computation was cancelled before it completed normally.public boolean isDone()
isDone in interface IgniteInternalFuture<T>True if computation is done, false otherwise.public T get() throws IgniteCheckedException
get in interface IgniteInternalFuture<T>IgniteInterruptedCheckedException - Subclass of IgniteCheckedException thrown if the wait was interrupted.IgniteFutureCancelledCheckedException - Subclass of IgniteCheckedException throws if computation was cancelled.IgniteCheckedException - If computation failed.public T get(long timeout) throws IgniteCheckedException
get(long, TimeUnit.MILLISECONDS).get in interface IgniteInternalFuture<T>timeout - The maximum time to wait in milliseconds.IgniteInterruptedCheckedException - Subclass of IgniteCheckedException thrown if the wait was interrupted.IgniteFutureTimeoutCheckedException - Subclass of IgniteCheckedException thrown if the wait was timed out.IgniteFutureCancelledCheckedException - Subclass of IgniteCheckedException throws if computation was cancelled.IgniteCheckedException - If computation failed.public T get(long timeout, TimeUnit unit) throws IgniteCheckedException
get in interface IgniteInternalFuture<T>timeout - The maximum time to wait.unit - The time unit of the timeout argument.IgniteInterruptedCheckedException - Subclass of IgniteCheckedException thrown if the wait was interrupted.IgniteFutureTimeoutCheckedException - Subclass of IgniteCheckedException thrown if the wait was timed out.IgniteFutureCancelledCheckedException - Subclass of IgniteCheckedException throws if computation was cancelled.IgniteCheckedException - If computation failed.public T getUninterruptibly() throws IgniteCheckedException
getUninterruptibly in interface IgniteInternalFuture<T>IgniteFutureCancelledCheckedException - Subclass of IgniteCheckedException throws if computation
was cancelled.IgniteCheckedException - If computation failed.public void listen(IgniteInClosure<? super IgniteInternalFuture<T>> lsnr)
listen in interface IgniteInternalFuture<T>lsnr - Listener closure to register. If not provided - this method is no-op.public <R> IgniteInternalFuture<R> chain(IgniteClosure<? super IgniteInternalFuture<T>,R> doneCb)
chain in interface IgniteInternalFuture<T>doneCb - Done callback that is applied to this future when it finishes to produce chained future result.public <T1> IgniteInternalFuture<T1> chain(IgniteClosure<? super IgniteInternalFuture<T>,T1> doneCb, Executor exec)
chain in interface IgniteInternalFuture<T>doneCb - Done callback that is applied to this future when it finishes to produce chained future result.exec - Executor to run callback.public <R> IgniteInternalFuture<R> chainCompose(IgniteClosure<? super IgniteInternalFuture<T>,IgniteInternalFuture<R>> doneCb)
doneCb is executed. Callback is called with this future
as the argument, when this future completes. It is guaranteed that done callback will be called only ONCE.chainCompose in interface IgniteInternalFuture<T>R - Type parameter.doneCb - Done callback.public <R> IgniteInternalFuture<R> chainCompose(IgniteClosure<? super IgniteInternalFuture<T>,IgniteInternalFuture<R>> doneCb, @Nullable @Nullable Executor exec)
doneCb is executed. Callback is called with this future
as the argument, when this future completes. It is guaranteed that done callback will be called only ONCE.chainCompose in interface IgniteInternalFuture<T>R - Type parameter.doneCb - Done callback.exec - Executor to run callback.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023