Package io.vertx.core.file
Interface AsyncFileLock
-
public interface AsyncFileLock
A lock on a region of anAsyncFile
.
-
-
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 correspondingAsyncFile
is closed.boolean
isValidBlocking()
LikeisValid()
but blocking.boolean
overlaps(long position, long size)
long
position()
Future<Void>
release()
Releases this lock;void
releaseBlocking()
Likerelease()
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, otherwisefalse
-
overlaps
boolean overlaps(long position, long size)
- Returns:
true
if this lock overlaps with the range described byposition
andsize
, otherwisefalse
-
isValidBlocking
boolean isValidBlocking()
LikeisValid()
but blocking.- Throws:
FileSystemException
- if an error occurs
-
isValid
Future<Boolean> isValid()
A lock remains valid until it is released or the file correspondingAsyncFile
is closed.
-
releaseBlocking
void releaseBlocking()
Likerelease()
but blocking.- Throws:
FileSystemException
- if an error occurs
-
-