Class LockManagerImpl
java.lang.Object
io.jmix.core.pessimisticlocking.impl.LockManagerImpl
- All Implemented Interfaces:
LockManager
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.cache.CacheManager
protected CacheOperations
protected Map<String,
LockDescriptor> protected CurrentAuthentication
protected ExtendedEntities
protected List<LockDescriptorProvider>
protected org.springframework.cache.Cache
protected static final org.slf4j.Logger
protected Metadata
protected MetadataTools
protected TimeSource
Fields inherited from interface io.jmix.core.pessimisticlocking.LockManager
LOCKS_CACHE_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Process locks expiring.protected Map<String,
LockDescriptor> Collection of current locksgetLockInfo
(String name, String id) Get locking status for particular objectprotected void
init()
Try to lock an entity.Try to lock an arbitrary object.void
void
Unlock an entity.void
Unlock an arbitrary object.
-
Field Details
-
log
protected static final org.slf4j.Logger log -
config
-
locks
protected org.springframework.cache.Cache locks -
extendedEntities
-
metadata
-
metadataTools
-
timeSource
-
currentAuthentication
-
cacheManager
@Autowired protected org.springframework.cache.CacheManager cacheManager -
cacheOperations
-
lockDescriptorProviders
-
-
Constructor Details
-
LockManagerImpl
public LockManagerImpl()
-
-
Method Details
-
init
@PostConstruct protected void init() -
getConfig
-
lock
Description copied from interface:LockManager
Try to lock an arbitrary object.- Specified by:
lock
in interfaceLockManager
- 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
Description copied from interface:LockManager
Try to lock an entity.- Specified by:
lock
in interfaceLockManager
- 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
Description copied from interface:LockManager
Unlock an arbitrary object.- Specified by:
unlock
in interfaceLockManager
- Parameters:
name
- locking object nameid
- locking object ID
-
unlock
Description copied from interface:LockManager
Unlock an entity.- Specified by:
unlock
in interfaceLockManager
- Parameters:
entity
- entity instance
-
getLockInfo
Description copied from interface:LockManager
Get locking status for particular object- Specified by:
getLockInfo
in interfaceLockManager
- 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
Description copied from interface:LockManager
Collection of current locks- Specified by:
getCurrentLocks
in interfaceLockManager
-
expireLocks
public void expireLocks()Description copied from interface:LockManager
Process locks expiring. All expired locks will be removed.- Specified by:
expireLocks
in interfaceLockManager
-
reloadConfiguration
public void reloadConfiguration()- Specified by:
reloadConfiguration
in interfaceLockManager
-