public class GridKeyLock extends Object
Map resources values to some number of locks, and supply convenience methods to obtain and release these locks using key values.
| Constructor and Description |
|---|
GridKeyLock() |
| Modifier and Type | Method and Description |
|---|---|
<T> Object |
lock(T key) |
<T> Object |
lockInterruptibly(T key) |
String |
toString() |
<T> @Nullable Object |
tryLock(T key) |
<T> void |
unlock(T key,
Object sync) |
public <T> Object lockInterruptibly(T key) throws InterruptedException
key - Key to lock.unlock(Object, Object) method.InterruptedException - If interrupted while acquiring lock.public <T> Object lock(T key)
key - Key to lock.unlock(Object, Object) method.@Nullable public <T> @Nullable Object tryLock(T key)
key - Key to lock.unlock(Object, Object) method or
null if try lock failed.public <T> void unlock(T key,
Object sync)
key - Key.sync - Sync that got from lockInterruptibly(Object) call.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.0 Release Date : February 27 2020