Package io.jmix.pessimisticlock
Interface LockManager
- All Known Implementing Classes:
LockManagerImpl
public interface LockManager
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Process locks expiring.Collection of current locksgetLockInfo
(String name, String id) Get locking status for particular objectTry to lock an entity.Try to lock an arbitrary object.void
void
Unlock an entity.void
Unlock 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,
-LockNotSupported
instance in case of locking is not configured for this object,
-LockInfo
instance 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,
-LockNotSupported
instance in case of locking is not configured for this entity,
-LockInfo
instance 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 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,
-LockNotSupported
instance in case of locking is not configured for this object,
-LockInfo
instance 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()
-