Class LockManagerImpl

java.lang.Object
io.jmix.core.pessimisticlocking.impl.LockManagerImpl
All Implemented Interfaces:
LockManager

@Component("core_LockManager") public class LockManagerImpl extends Object implements LockManager
  • Field Details

    • log

      protected static final org.slf4j.Logger log
    • config

      protected volatile Map<String,LockDescriptor> config
    • locks

      protected org.springframework.cache.Cache locks
    • extendedEntities

      @Autowired protected ExtendedEntities extendedEntities
    • metadata

      @Autowired protected Metadata metadata
    • metadataTools

      @Autowired protected MetadataTools metadataTools
    • timeSource

      @Autowired protected TimeSource timeSource
    • currentAuthentication

      @Autowired protected CurrentAuthentication currentAuthentication
    • cacheManager

      @Autowired protected org.springframework.cache.CacheManager cacheManager
    • cacheOperations

      @Autowired protected CacheOperations cacheOperations
    • lockDescriptorProviders

      @Autowired protected List<LockDescriptorProvider> lockDescriptorProviders
  • Constructor Details

    • LockManagerImpl

      public LockManagerImpl()
  • Method Details

    • init

      @PostConstruct protected void init()
    • getConfig

      protected Map<String,LockDescriptor> getConfig()
    • lock

      public LockInfo lock(String name, String id)
      Description copied from interface: LockManager
      Try to lock an arbitrary object.
      Specified by:
      lock in interface LockManager
      Parameters:
      name - locking object name
      id - 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

      @Nullable public LockInfo lock(Object entity)
      Description copied from interface: LockManager
      Try to lock an entity.
      Specified by:
      lock in interface LockManager
      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

      public void unlock(String name, String id)
      Description copied from interface: LockManager
      Unlock an arbitrary object.
      Specified by:
      unlock in interface LockManager
      Parameters:
      name - locking object name
      id - locking object ID
    • unlock

      public void unlock(Object entity)
      Description copied from interface: LockManager
      Unlock an entity.
      Specified by:
      unlock in interface LockManager
      Parameters:
      entity - entity instance
    • getLockInfo

      public LockInfo getLockInfo(String name, String id)
      Description copied from interface: LockManager
      Get locking status for particular object
      Specified by:
      getLockInfo in interface LockManager
      Parameters:
      name - locking object name
      id - 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

      public Collection<LockInfo> getCurrentLocks()
      Description copied from interface: LockManager
      Collection of current locks
      Specified by:
      getCurrentLocks in interface LockManager
    • expireLocks

      public void expireLocks()
      Description copied from interface: LockManager
      Process locks expiring. All expired locks will be removed.
      Specified by:
      expireLocks in interface LockManager
    • reloadConfiguration

      public void reloadConfiguration()
      Specified by:
      reloadConfiguration in interface LockManager