Interface DistributedLock.Lease

All Superinterfaces:
AutoCloseable
Enclosing interface:
DistributedLock

public static interface DistributedLock.Lease extends AutoCloseable
A lock claim that releases only its own ownership token when closed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Releases this lease; repeated calls must be harmless.
    boolean
    renew(Duration duration)
    Extends this lease only if it is still owned by this instance.
  • Method Details

    • renew

      boolean renew(Duration duration)
      Extends this lease only if it is still owned by this instance.
      Parameters:
      duration - new lifetime measured from the renewal
      Returns:
      whether ownership was retained and extended
    • close

      void close()
      Releases this lease; repeated calls must be harmless.
      Specified by:
      close in interface AutoCloseable