Package io.vertx.reactivex.core.file
Class AsyncFileLock
- java.lang.Object
-
- io.vertx.reactivex.core.file.AsyncFileLock
-
public class AsyncFileLock extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<AsyncFileLock>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description AsyncFileLock(AsyncFileLock delegate)
AsyncFileLock(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
AsyncFileLock
getDelegate()
int
hashCode()
boolean
isShared()
Future<Boolean>
isValid()
A lock remains valid until it is released or the file correspondingAsyncFile
is closed.boolean
isValidBlocking()
LikeisValid()
but blocking.static AsyncFileLock
newInstance(AsyncFileLock arg)
boolean
overlaps(long position, long size)
long
position()
Future<Void>
release()
Releases this lock;void
releaseBlocking()
Likerelease()
but blocking.Single<Boolean>
rxIsValid()
A lock remains valid until it is released or the file correspondingAsyncFile
is closed.Completable
rxRelease()
Releases this lock;long
size()
String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<AsyncFileLock> __TYPE_ARG
-
-
Constructor Detail
-
AsyncFileLock
public AsyncFileLock(AsyncFileLock delegate)
-
AsyncFileLock
public AsyncFileLock(Object delegate)
-
-
Method Detail
-
getDelegate
public AsyncFileLock getDelegate()
-
position
public long position()
- Returns:
- the position of the first byte of the locked region
-
size
public long size()
- Returns:
- the size in bytes of the locked region
-
isShared
public boolean isShared()
- Returns:
true
if this lock is shared, otherwisefalse
-
overlaps
public boolean overlaps(long position, long size)
- Parameters:
position
-size
-- Returns:
true
if this lock overlaps with the range described byposition
andsize
, otherwisefalse
-
isValidBlocking
public boolean isValidBlocking()
LikeisValid()
but blocking.- Returns:
-
isValid
public Future<Boolean> isValid()
A lock remains valid until it is released or the file correspondingAsyncFile
is closed.- Returns:
-
rxIsValid
public Single<Boolean> rxIsValid()
A lock remains valid until it is released or the file correspondingAsyncFile
is closed.- Returns:
-
releaseBlocking
public void releaseBlocking()
Likerelease()
but blocking.
-
rxRelease
public Completable rxRelease()
Releases this lock;- Returns:
-
newInstance
public static AsyncFileLock newInstance(AsyncFileLock arg)
-
-