Interface LockManager

All Known Implementing Classes:
LockManagerImpl

public interface LockManager
  • Field Details

  • Method Details

    • lock

      @Nullable LockInfo lock(String name, String id)
      Try to lock an arbitrary object.
      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 LockInfo lock(Object entity)
      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

      void unlock(String name, String id)
      Unlock an arbitrary object.
      Parameters:
      name - locking object name
      id - locking object ID
    • unlock

      void unlock(Object entity)
      Unlock an entity.
      Parameters:
      entity - entity instance
    • getLockInfo

      @Nullable LockInfo getLockInfo(String name, String id)
      Get locking status for particular object
      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

      Collection<LockInfo> getCurrentLocks()
      Collection of current locks
    • expireLocks

      void expireLocks()
      Process locks expiring. All expired locks will be removed.
    • reloadConfiguration

      void reloadConfiguration()