Interface ResourceLock<T>

All Known Implementing Classes:
ResourceLockImpl

public interface ResourceLock<T>
Represent a lock that the current process has on a shared resource.
  • Method Details

    • getPath

      String getPath()
      Returns:
      the path associated with the lock
    • getValue

      T getValue()
      Returns:
      the value associated with the lock
    • updateValue

      CompletableFuture<Void> updateValue(T newValue)
      Update the value of the lock.
      Returns:
      a future to track when the release operation is complete
    • release

      Release the lock on the resource.
      Returns:
      a future to track when the release operation is complete
    • getLockExpiredFuture

      CompletableFuture<Void> getLockExpiredFuture()
      Get a future that can be used to get notified when the lock is expired or it gets released.
      Returns:
      a future to get notification if the lock is expired