Interface ILockableCacheProvider


public interface ILockableCacheProvider
Interface for cache providers which offer distributed locking functionality.
  • Method Summary

    Modifier and Type
    Method
    Description
    acquireLock(String lockKey, int acquireTimeoutMillis, int expiryTimeMillis)
    Acquire a distributed lock for the given key.
    void
    Release a distributed lock for the given key.
    boolean
    renewLock(ILock lock, int expiryTimeMillis)
    Renew a distributed lock for the given key.
  • Method Details

    • acquireLock

      ILock acquireLock(String lockKey, int acquireTimeoutMillis, int expiryTimeMillis)
      Acquire a distributed lock for the given key.
      Parameters:
      lockKey - The key to lock.
      acquireTimeoutMillis - The maximum time to wait to acquire the lock in milliseconds.
      expiryTimeMillis - The time after which the lock will expire in milliseconds.
      Returns:
      An ILock instance representing the acquired lock.
    • renewLock

      boolean renewLock(ILock lock, int expiryTimeMillis)
      Renew a distributed lock for the given key.
      Parameters:
      expiryTimeMillis - The new expiry time for the lock in milliseconds.
      lockKey - The key to renew the lock for.
      Returns:
      True if the lock was successfully renewed, false otherwise.
    • releaseLock

      void releaseLock(ILock lock)
      Release a distributed lock for the given key.
      Parameters:
      lock - The lock to release.