Interface RenewableLockRegistry

All Superinterfaces:
LockRegistry
All Known Implementing Classes:
JdbcLockRegistry, RedisLockRegistry

public interface RenewableLockRegistry extends LockRegistry
A LockRegistry implementing this interface supports the renewal of the time to live of a lock.
Since:
5.4
Author:
Alexandre Strubel, Artem Bilan, Youbin Wu
  • Method Details

    • renewLock

      void renewLock(Object lockKey)
      Renew the time to live of the lock is associated with the parameter object. The lock must be held by the current thread
      Parameters:
      lockKey - The object with which the lock is associated.
    • setRenewalTaskScheduler

      default void setRenewalTaskScheduler(TaskScheduler renewalTaskScheduler)
      Set the TaskScheduler to use for the renewal task. When renewalTaskScheduler is set, it will be used to periodically renew the lock to ensure that the lock does not expire while the thread is working.
      Parameters:
      renewalTaskScheduler - renew task scheduler
      Since:
      6.4