Interface RenewableLockRegistry<L extends Lock>

Type Parameters:
L - The expected class of the lock implementation
All Superinterfaces:
LockRegistry<L>
All Known Implementing Classes:
JdbcLockRegistry, RedisLockRegistry

public interface RenewableLockRegistry<L extends Lock> extends LockRegistry<L>
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, Eddie Cho
  • 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.
    • renewLock

      void renewLock(Object lockKey, Duration ttl)
      Renew the time to live of the lock is associated with the parameter object with a specific value. The lock must be held by the current thread
      Parameters:
      lockKey - The object with which the lock is associated.
      ttl - the specific time-to-live for the lock status data
      Since:
      7.0
    • 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