Package io.vertx.core.file
Interface AsyncFileLock
-
public interface AsyncFileLockA lock on a region of anAsyncFile.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisShared()Future<Boolean>isValid()A lock remains valid until it is released or the file correspondingAsyncFileis closed.booleanisValidBlocking()LikeisValid()but blocking.booleanoverlaps(long position, long size)longposition()Future<Void>release()Releases this lock;voidreleaseBlocking()Likerelease()but blocking.longsize()
-
-
-
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:
trueif this lock is shared, otherwisefalse
-
overlaps
boolean overlaps(long position, long size)- Returns:
trueif this lock overlaps with the range described bypositionandsize, 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 correspondingAsyncFileis closed.
-
releaseBlocking
void releaseBlocking()
Likerelease()but blocking.- Throws:
FileSystemException- if an error occurs
-
-