Interface DistributedLock

    • Method Detail

      • lock

        Version lock()
        Acquires the lock, blocking until it's available.
        Returns:
        the acquired lock version
      • tryLock

        java.util.Optional<Version> tryLock()
        Attempts to acquire the lock.
        Returns:
        indicates whether the lock was acquired
      • tryLock

        java.util.Optional<Version> tryLock​(java.time.Duration timeout)
        Attempts to acquire the lock for a specified amount of time.
        Parameters:
        timeout - the timeout after which to give up attempting to acquire the lock
        Returns:
        indicates whether the lock was acquired
      • unlock

        void unlock()
        Unlocks the lock.