Interface AsyncFileLock
public interface AsyncFileLock
A lock on a region of an
AsyncFile.-
Method Summary
Modifier and TypeMethodDescriptionbooleanisShared()isValid()A lock remains valid until it is released or the file correspondingAsyncFileis closed.booleanLikeisValid()but blocking.booleanoverlaps(long position, long size) longposition()release()Releases this lock;voidLikerelease()but blocking.longsize()
-
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
-
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
-
releaseBlocking
void releaseBlocking()Likerelease()but blocking.- Throws:
FileSystemException- if an error occurs
-
release
-