org.apache.ignite.internal.util.lang

## Interface GridPlainFuture<R>

All Known Implementing Classes:
  GridPlainFutureAdapter

    public interface GridPlainFuture<R>

Future that does not depend on kernal context.

### Method Summary

Methods
`<T> GridPlainFuture<T>` `chain(GridPlainClosure<GridPlainFuture<R>,T> cb)` Creates a future that will be completed after this future is completed.
`R` `get()` Synchronously waits for completion and returns result.
`R` `get(long timeout, TimeUnit unit)` Synchronously waits for completion and returns result.
`boolean` `isDone()` Checks if future is done.
`void` `listenAsync(GridPlainInClosure<GridPlainFuture<R>>... lsnrs)` Register new listeners for notification when future completes.
`void` `stopListenAsync(GridPlainInClosure<GridPlainFuture<R>>... lsnrs)` Removes listeners registered before.

### Method Detail

#### get

    R get()
          throws IgniteCheckedException

Synchronously waits for completion and returns result.

Returns:
  Completed future result.
Throws:
  `IgniteCheckedException` - In case of error.

#### get

    R get(long timeout,
        TimeUnit unit)
          throws IgniteCheckedException

Synchronously waits for completion and returns result.

Parameters:
  `timeout` - Timeout interval to wait future completes.
  `unit` - Timeout interval unit to wait future completes.
Returns:
  Completed future result.
Throws:
  `IgniteCheckedException` - In case of error.
  `IgniteFutureTimeoutCheckedException` - If timed out before future finishes.

#### isDone

    boolean isDone()

Checks if future is done.

Returns:
  Whether future is done.

#### listenAsync

    void listenAsync(GridPlainInClosure<GridPlainFuture<R>>... lsnrs)

Register new listeners for notification when future completes. Note that current implementations are calling listeners in the completing thread.

Parameters:
  `lsnrs` - Listeners to be registered.

#### stopListenAsync

    void stopListenAsync(GridPlainInClosure<GridPlainFuture<R>>... lsnrs)

Removes listeners registered before.

Parameters:
  `lsnrs` - Listeners to be removed.

#### chain

    <T> GridPlainFuture<T> chain(GridPlainClosure<GridPlainFuture<R>,T> cb)

Creates a future that will be completed after this future is completed. The result of created future is value returned by `cb` closure invoked on this future.

Parameters:
  `cb` - Callback closure.
Returns:
  Chained future.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015