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 Constructor Description FutureHolder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawait()Awaits for previous async operation to be completed.IgniteInternalFuture<?>future()Gets future.voidfuture(@Nullable IgniteInternalFuture<?> fut)Sets future.booleanholdsLock()voidlock()Acquires lock.voidsaveFuture(IgniteInternalFuture<?> fut)Saves future in the holder and adds listener that will clear holder when future is finished.booleantryLock()Tries to acquire lock.voidunlock()Releases lock.
-
-
-
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.
-
-