Package org.apache.ignite.internal.processors.cache

## Class GridCacheAdapter.FutureHolder

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheAdapter.FutureHolder

Enclosing class:
  GridCacheAdapter<K,​V>

    public static class GridCacheAdapter.FutureHolder
    extends Object

Holder for last async operation future.

### Constructor Summary

Constructors
`FutureHolder()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `await()` Awaits for previous async operation to be completed.
`IgniteInternalFuture<?>` `future()` Gets future.
`void` `future​(@Nullable IgniteInternalFuture<?> fut)` Sets future.
`boolean` `holdsLock()`
`void` `lock()` Acquires lock.
`void` `saveFuture​(IgniteInternalFuture<?> fut)` Saves future in the holder and adds listener that will clear holder when future is finished.
`boolean` `tryLock()` Tries to acquire lock.
`void` `unlock()` Releases lock.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FutureHolder

    public FutureHolder()

### Method Detail

#### tryLock

    public boolean tryLock()

Tries to acquire lock.

Returns:
  Whether lock was actually acquired.

#### lock

    public void lock()

Acquires lock.

#### unlock

    public void unlock()

Releases lock.

#### holdsLock

    public boolean holdsLock()

Returns:
  Whether lock is held by current thread.

#### future

    public IgniteInternalFuture<?> future()

Gets future.

Returns:
  Future.

#### future

    public void future​(@Nullable
                       @Nullable IgniteInternalFuture<?> fut)

Sets future.

Parameters:
  `fut` - Future.

#### await

    public void await()

Awaits for previous async operation to be completed.

#### saveFuture

    public void saveFuture​(IgniteInternalFuture<?> fut)

Saves future in the holder and adds listener that will clear holder when future is finished.

Parameters:
  `fut` - Future to save.