Interface AsyncFileLock


public interface AsyncFileLock
A lock on a region of an AsyncFile.
  • Method Details

    • position

      long position()
      Returns:
      the position of the first byte of the locked region
    • size

      long size()
      Returns:
      the size in bytes of the locked region
    • isShared

      boolean isShared()
      Returns:
      true if this lock is shared, otherwise false
    • overlaps

      boolean overlaps(long position, long size)
      Returns:
      true if this lock overlaps with the range described by position and size, otherwise false
    • isValidBlocking

      boolean isValidBlocking()
      Like isValid() but blocking.
      Throws:
      FileSystemException - if an error occurs
    • isValid

      Future<Boolean> isValid()
      A lock remains valid until it is released or the file corresponding AsyncFile is closed.
    • releaseBlocking

      void releaseBlocking()
      Like release() but blocking.
      Throws:
      FileSystemException - if an error occurs
    • release

      Future<Void> release()
      Releases this lock;