Package io.vertx.mutiny.core.file
Class AsyncFileLock
- java.lang.Object
-
- io.vertx.mutiny.core.file.AsyncFileLock
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<AsyncFileLock>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description AsyncFileLock(io.vertx.core.file.AsyncFileLock delegate)
AsyncFileLock(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
io.vertx.core.file.AsyncFileLock
getDelegate()
int
hashCode()
boolean
isShared()
io.smallrye.mutiny.Uni<Boolean>
isValid()
LikeisValid()
but thehandler
will be called when the operation completes or if an error occurs.Boolean
isValidAndAwait()
Blocking variant ofisValid()
.void
isValidAndForget()
Variant ofisValid()
that ignores the result of the operation.boolean
isValidBlocking()
static AsyncFileLock
newInstance(io.vertx.core.file.AsyncFileLock arg)
boolean
overlaps(long position, long size)
long
position()
io.smallrye.mutiny.Uni<Void>
release()
Likerelease()
but thehandler
will be called when the operation completes or if an error occurs.Void
releaseAndAwait()
Blocking variant ofrelease()
.void
releaseAndForget()
Variant ofrelease()
that ignores the result of the operation.void
releaseBlocking()
long
size()
String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<AsyncFileLock> __TYPE_ARG
-
-
Constructor Detail
-
AsyncFileLock
public AsyncFileLock(io.vertx.core.file.AsyncFileLock delegate)
-
AsyncFileLock
public AsyncFileLock(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.core.file.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()
- Returns:
-
isValid
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> isValid()
LikeisValid()
but thehandler
will be called when the operation completes or if an error occurs.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
isValidAndAwait
public Boolean isValidAndAwait()
Blocking variant ofisValid()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Boolean instance produced by the operation.
-
isValidAndForget
public void isValidAndForget()
-
releaseBlocking
public void releaseBlocking()
-
release
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> release()
Likerelease()
but thehandler
will be called when the operation completes or if an error occurs.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
releaseAndAwait
public Void releaseAndAwait()
Blocking variant ofrelease()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
releaseAndForget
public void releaseAndForget()
-
newInstance
public static AsyncFileLock newInstance(io.vertx.core.file.AsyncFileLock arg)
-
-