Class ResourceLockImpl<T>

  • All Implemented Interfaces:
    ResourceLock<T>

    public class ResourceLockImpl<T>
    extends java.lang.Object
    implements ResourceLock<T>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Void> getLockExpiredFuture()
      Get a future that can be used to get notified when the lock is expired or it gets released.
      java.lang.String getPath()  
      T getValue()  
      int hashCode()  
      java.util.concurrent.CompletableFuture<java.lang.Void> release()
      Release the lock on the resource.
      java.util.concurrent.CompletableFuture<java.lang.Void> updateValue​(T newValue)
      Update the value of the lock.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getValue

        public T getValue()
        Specified by:
        getValue in interface ResourceLock<T>
        Returns:
        the value associated with the lock
      • updateValue

        public java.util.concurrent.CompletableFuture<java.lang.Void> updateValue​(T newValue)
        Description copied from interface: ResourceLock
        Update the value of the lock.
        Specified by:
        updateValue in interface ResourceLock<T>
        Returns:
        a future to track when the release operation is complete
      • release

        public java.util.concurrent.CompletableFuture<java.lang.Void> release()
        Description copied from interface: ResourceLock
        Release the lock on the resource.
        Specified by:
        release in interface ResourceLock<T>
        Returns:
        a future to track when the release operation is complete
      • getLockExpiredFuture

        public java.util.concurrent.CompletableFuture<java.lang.Void> getLockExpiredFuture()
        Description copied from interface: ResourceLock
        Get a future that can be used to get notified when the lock is expired or it gets released.
        Specified by:
        getLockExpiredFuture in interface ResourceLock<T>
        Returns:
        a future to get notification if the lock is expired
      • getPath

        public java.lang.String getPath()
        Specified by:
        getPath in interface ResourceLock<T>
        Returns:
        the path associated with the lock
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object