Package io.jmix.pessimisticlock
Interface LockManager
- All Known Implementing Classes:
LockManagerImpl
@NullMarked
public interface LockManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidProcess locks expiring.Collection of current locks@Nullable LockInfogetLockInfo(String name, String id) Get locking status for particular object@Nullable LockInfoTry to lock an entity.@Nullable LockInfoTry to lock an arbitrary object.voidvoidUnlock an entity.voidUnlock an arbitrary object.default voidUnlock an arbitrary object.
-
Field Details
-
LOCKS_CACHE_NAME
- See Also:
-
-
Method Details
-
lock
Try to lock an arbitrary object.- Parameters:
name- locking object nameid- locking object ID- Returns:
- - null in case of successful lock,
-LockNotSupportedinstance in case of locking is not configured for this object,
-LockInfoinstance in case of this object is already locked by someone
-
lock
Try to lock an entity.- Parameters:
entity- entity instance- Returns:
- - null in case of successful lock,
-LockNotSupportedinstance in case of locking is not configured for this entity,
-LockInfoinstance in case of this entity is already locked by someone
-
unlock
Unlock an arbitrary object.- Parameters:
name- locking object nameid- locking object ID
-
unlock
Unlock an arbitrary object.- Parameters:
name- locking object nameid- locking object IDforce- force unlock even if the lock is not owned by the current owner
-
unlock
Unlock an entity.- Parameters:
entity- entity instance
-
getLockInfo
Get locking status for particular object- Parameters:
name- locking object nameid- locking object ID- Returns:
- - null in case of no lock,
-LockNotSupportedinstance in case of locking is not configured for this object,
-LockInfoinstance in case of this object is locked by someone
-
getCurrentLocks
Collection<LockInfo> getCurrentLocks()Collection of current locks -
expireLocks
void expireLocks()Process locks expiring. All expired locks will be removed. -
reloadConfiguration
void reloadConfiguration()
-