Top Description Methods
io.vertx.core.file

public Interface AsyncFileLock

Known Direct Implementers
io.vertx.core.file.impl.AsyncFileLockImpl
Annotations
@VertxGen
Imports
io.vertx.codegen.annotations.VertxGen, io.vertx.core.AsyncResult, .Future, .Handler

A lock on a region of an AsyncFile.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this lock is shared, otherwise false
isShared
()

public Future<Boolean>
isValid()

A lock remains valid until it is released or the file corresponding AsyncFile is closed.

public void
isValid(Handler<AsyncResult<Boolean>> handler)

Like isValid() but the handler will be called when the operation completes or if an error occurs.

public boolean
isValidBlocking()

Like isValid() but blocking.

public boolean

Returns:

true if this lock overlaps with the range described by position and size, otherwise false
overlaps
(long position, long size)

public long

Returns:

the position of the first byte of the locked region
position
()

public Future<Void>
release()

Releases this lock;

public void
release(Handler<AsyncResult<Void>> handler)

Like release() but the handler will be called when the operation completes or if an error occurs.

public void
releaseBlocking()

Like release() but blocking.

public long

Returns:

the size in bytes of the locked region
size
()

Method Detail

isSharedback to summary
public boolean isShared()
Returns:boolean

true if this lock is shared, otherwise false

isValidback to summary
public Future<Boolean> isValid()

A lock remains valid until it is released or the file corresponding AsyncFile is closed.

isValidback to summary
public void isValid(Handler<AsyncResult<Boolean>> handler)

Like isValid() but the handler will be called when the operation completes or if an error occurs.

isValidBlockingback to summary
public boolean isValidBlocking()

Like isValid() but blocking.

Exceptions
FileSystemException:
if an error occurs
overlapsback to summary
public boolean overlaps(long position, long size)
Returns:boolean

true if this lock overlaps with the range described by position and size, otherwise false

positionback to summary
public long position()
Returns:long

the position of the first byte of the locked region

releaseback to summary
public Future<Void> release()

Releases this lock;

releaseback to summary
public void release(Handler<AsyncResult<Void>> handler)

Like release() but the handler will be called when the operation completes or if an error occurs.

releaseBlockingback to summary
public void releaseBlocking()

Like release() but blocking.

Exceptions
FileSystemException:
if an error occurs
sizeback to summary
public long size()
Returns:long

the size in bytes of the locked region