Interface DistributedLock

All Superinterfaces:
Lock

public interface DistributedLock extends Lock
A distributed Lock extension.
Since:
7.0
Author:
Eddie Cho
  • Method Details

    • lock

      void lock(Duration ttl)
      Attempt to acquire a lock with a specific time-to-live
      Parameters:
      ttl - the specific time-to-live for the lock status data
    • tryLock

      boolean tryLock(Duration waitTime, Duration ttl) throws InterruptedException
      Attempt to acquire a lock with a specific time-to-live
      Parameters:
      waitTime - the maximum time to wait for the lock
      ttl - the specific time-to-live for the lock status data
      Returns:
      true if the lock was acquired and false if the waiting time elapsed before the lock was acquired
      Throws:
      InterruptedException - if the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)