Class LockManagerImpl

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

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

    • log

      protected static final org.slf4j.Logger log
    • extendedEntities

      protected final ExtendedEntities extendedEntities
    • metadata

      protected final Metadata metadata
    • metadataTools

      protected final MetadataTools metadataTools
    • timeSource

      protected final TimeSource timeSource
    • currentAuthentication

      protected final CurrentAuthentication currentAuthentication
    • cacheManager

      protected final org.springframework.cache.CacheManager cacheManager
    • cacheOperations

      protected final CacheOperations cacheOperations
    • lockDescriptorProviders

      protected List<LockDescriptorProvider> lockDescriptorProviders
    • config

      protected volatile Map<String,LockDescriptor> config
    • locks

      protected org.springframework.cache.Cache locks
  • Constructor Details

  • 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