Package org.infinispan.lock.impl.lock
Class ClusteredLockImpl
- java.lang.Object
-
- org.infinispan.lock.impl.lock.ClusteredLockImpl
-
- All Implemented Interfaces:
org.infinispan.lock.api.ClusteredLock
public class ClusteredLockImpl extends Object implements org.infinispan.lock.api.ClusteredLock
ImplementsClusteredLockinterface.This lock implements a non reentrant where the ownership is
OwnershipLevel.NODE.Non reentrant lock, Owner Node
- Originator of the requests is the
Addressof theEmbeddedCacheManager- When a lock is acquired by a Node, it cannot be re-acquired, even by the actual node til the lock is released.
- The lock can be unlocked only by the lock owner, in this case the node
- lock method does not expire til the lock is acquired, so this can cause thread starvation in the actual implementation
Partition handling
- Since:
- 9.2
- Author:
- Katia Aresti, karesti@redhat.com
- See Also:
- Infinispan documentation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classClusteredLockImpl.LockRequestHolderclassClusteredLockImpl.RequestHolder<E>classClusteredLockImpl.TryLockRequestHolder
-
Constructor Summary
Constructors Constructor Description ClusteredLockImpl(String name, ClusteredLockKey lockKey, org.infinispan.AdvancedCache<ClusteredLockKey,ClusteredLockValue> clusteredLockCache, EmbeddedClusteredLockManager clusteredLockManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()ObjectgetOriginator()CompletableFuture<Boolean>isLocked()CompletableFuture<Boolean>isLockedByMe()CompletableFuture<Void>lock()voidstop()StringtoString()CompletableFuture<Boolean>tryLock()CompletableFuture<Boolean>tryLock(long time, TimeUnit unit)CompletableFuture<Void>unlock()
-
-
-
Constructor Detail
-
ClusteredLockImpl
public ClusteredLockImpl(String name, ClusteredLockKey lockKey, org.infinispan.AdvancedCache<ClusteredLockKey,ClusteredLockValue> clusteredLockCache, EmbeddedClusteredLockManager clusteredLockManager)
-
-
Method Detail
-
stop
public void stop()
-
lock
public CompletableFuture<Void> lock()
- Specified by:
lockin interfaceorg.infinispan.lock.api.ClusteredLock
-
tryLock
public CompletableFuture<Boolean> tryLock()
- Specified by:
tryLockin interfaceorg.infinispan.lock.api.ClusteredLock
-
tryLock
public CompletableFuture<Boolean> tryLock(long time, TimeUnit unit)
- Specified by:
tryLockin interfaceorg.infinispan.lock.api.ClusteredLock
-
unlock
public CompletableFuture<Void> unlock()
- Specified by:
unlockin interfaceorg.infinispan.lock.api.ClusteredLock
-
isLocked
public CompletableFuture<Boolean> isLocked()
- Specified by:
isLockedin interfaceorg.infinispan.lock.api.ClusteredLock
-
isLockedByMe
public CompletableFuture<Boolean> isLockedByMe()
- Specified by:
isLockedByMein interfaceorg.infinispan.lock.api.ClusteredLock
-
getName
public String getName()
-
getOriginator
public Object getOriginator()
-
-