public class IgniteFutureImpl<V> extends Object implements IgniteFuture<V>
| Modifier and Type | Field and Description |
|---|---|
protected IgniteInternalFuture<V> |
fut |
| Constructor and Description |
|---|
IgniteFutureImpl(IgniteInternalFuture<V> fut) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Cancels this future.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
<T> IgniteFuture<T> |
chain(IgniteClosure<? super IgniteFuture<V>,T> doneCb)
Make a chained future to convert result of this future (when complete) into a new format.
|
boolean |
concurrentNotify()
Gets value concurrent listener notification flag.
|
void |
concurrentNotify(boolean concurNotify)
Flag to turn on or off concurrent listener notification.
|
long |
duration()
Gets duration in milliseconds between start of the future and current time if future
is not finished, or between start and finish of this future.
|
V |
get()
Synchronously waits for completion of the computation and
returns computation result.
|
V |
get(long timeout)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
V |
get(long timeout,
TimeUnit unit)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
IgniteInternalFuture<V> |
internalFuture() |
boolean |
isCancelled() |
boolean |
isDone() |
void |
listenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr)
Registers listener closure to be asynchronously notified whenever future completes.
|
long |
startTime()
Gets start time for this future.
|
void |
stopListenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr)
Removes given listener from the future.
|
boolean |
syncNotify()
Gets value of synchronous listener notification flag.
|
void |
syncNotify(boolean syncNotify)
Flag to turn on or off synchronous listener notification.
|
String |
toString() |
protected final IgniteInternalFuture<V> fut
public IgniteFutureImpl(IgniteInternalFuture<V> fut)
fut - Future.public IgniteInternalFuture<V> internalFuture()
public long startTime()
startTime in interface IgniteFuture<V>public long duration()
duration in interface IgniteFuture<V>public void syncNotify(boolean syncNotify)
true, then
upon future completion the notification may happen in the same thread that created
the future. This becomes especially important when adding listener to a future that
is already done - if this flag is true, then listener will be
immediately notified within the same thread.
Default value is false. To change the default, set
IgniteSystemProperties.IGNITE_FUT_SYNC_NOTIFICATION system property to true.
syncNotify in interface IgniteFuture<V>syncNotify - Flag to turn on or off synchronous listener notification.public boolean syncNotify()
true, then
upon future completion the notification may happen in the same thread that created
the future. This becomes especially important when adding listener to a future that
is already done - if this flag is true, then listener will be
immediately notified within the same thread.
Default value is false. To change the default, set
IgniteSystemProperties.IGNITE_FUT_SYNC_NOTIFICATION system property to true.
syncNotify in interface IgniteFuture<V>public void concurrentNotify(boolean concurNotify)
true,
then all listeners will be notified concurrently by different threads; otherwise,
listeners will be notified one after another within one thread (depending on
IgniteFuture.syncNotify() flag, these notifications may happen either in the same thread which
started the future, or in a different thread).
Default value is false. To change the default, set
IgniteSystemProperties.IGNITE_FUT_CONCURRENT_NOTIFICATION system property to true.
concurrentNotify in interface IgniteFuture<V>concurNotify - Flag to turn on or off concurrent listener notification.public boolean concurrentNotify()
true,
then all listeners will be notified concurrently by different threads; otherwise,
listeners will be notified one after another within one thread (depending on
IgniteFuture.syncNotify() flag, these notifications may happen either in the same thread which
started the future, or in a different thread).
Default value is false. To change the default, set
IgniteSystemProperties.IGNITE_FUT_CONCURRENT_NOTIFICATION system property to true.
concurrentNotify in interface IgniteFuture<V>public boolean isCancelled()
isCancelled in interface Future<V>public void listenAsync(@Nullable IgniteInClosure<? super IgniteFuture<V>> lsnr)
listenAsync in interface IgniteFuture<V>lsnr - Listener closure to register. If not provided - this method is no-op.public void stopListenAsync(IgniteInClosure<? super IgniteFuture<V>> lsnr)
stopListenAsync in interface IgniteFuture<V>lsnr - Listener to remove.public <T> IgniteFuture<T> chain(IgniteClosure<? super IgniteFuture<V>,T> doneCb)
chain in interface IgniteFuture<V>doneCb - Done callback that is applied to this future when it finishes to produce chained future result.public boolean cancel()
throws IgniteException
cancel in interface IgniteFuture<V>True if future was canceled (i.e. was not finished prior to this call).IgniteException - If cancellation failed.public boolean cancel(boolean mayInterruptIfRunning)
public V get()
public V get(long timeout)
get(long, TimeUnit.MILLISECONDS).get in interface IgniteFuture<V>timeout - The maximum time to wait in milliseconds.public V get(long timeout, TimeUnit unit)
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 17 2015