Interface AsyncFileLock


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

      • 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
      • isValid

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

        Future<Void> release()
        Releases this lock;