Package io.vertx.core.file

## Interface AsyncFileLock

-     public interface AsyncFileLock

  A lock on a region of an `AsyncFile`.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `isShared()` |
    `Future<Boolean>` | `isValid()` | A lock remains valid until it is released or the file corresponding `AsyncFile` is closed.
    `boolean` | `isValidBlocking()` | Like `isValid()` but blocking.
    `boolean` | `overlaps​(long position, long size)` |
    `long` | `position()` |
    `Future<Void>` | `release()` | Releases this lock;
    `void` | `releaseBlocking()` | Like `release()` but blocking.
    `long` | `size()` |

- - ### 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`

    - #### 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;