Top Fields Constructors Methods
io.vertx.core.file.impl

public Class AsyncFileLockImpl

extends Object
implements AsyncFileLock
Class Inheritance
All Implemented Interfaces
io.vertx.core.file.AsyncFileLock
Imports
io.vertx.core.AsyncResult, .Future, .Handler, io.vertx.core.file.AsyncFileLock, .FileSystemException, io.vertx.core.impl.VertxInternal, java.io.IOException, java.nio.channels.FileLock, java.util.Objects

Field Summary

Modifier and TypeField and Description
private final FileLock
private final VertxInternal

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public Future<Boolean>
isValid()

Implements io.vertx.core.file.AsyncFileLock.isValid.

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

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

Implements io.vertx.core.file.AsyncFileLock.isValid.

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

public boolean
public boolean
overlaps(long position, long size)

Implements io.vertx.core.file.AsyncFileLock.overlaps.

public long
public Future<Void>
release()

Implements io.vertx.core.file.AsyncFileLock.release.

Releases this lock;

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

Implements io.vertx.core.file.AsyncFileLock.release.

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

public void
public long
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fileLockback to summary
private final FileLock fileLock
vertxback to summary
private final VertxInternal vertx

Constructor Detail

AsyncFileLockImplback to summary
public AsyncFileLockImpl(VertxInternal vertx, FileLock fileLock)

Method Detail

isSharedback to summary
public boolean isShared()

Implements io.vertx.core.file.AsyncFileLock.isShared.

Returns:boolean

Doc from io.vertx.core.file.AsyncFileLock.isShared.

true if this lock is shared, otherwise false

Annotations
@Override
isValidback to summary
public Future<Boolean> isValid()

Implements io.vertx.core.file.AsyncFileLock.isValid.

Doc from io.vertx.core.file.AsyncFileLock.isValid.

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

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

Implements io.vertx.core.file.AsyncFileLock.isValid.

Doc from io.vertx.core.file.AsyncFileLock.isValid.

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

Annotations
@Override
isValidBlockingback to summary
public boolean isValidBlocking()

Implements io.vertx.core.file.AsyncFileLock.isValidBlocking.

Doc from io.vertx.core.file.AsyncFileLock.isValidBlocking.

Like isValid() but blocking.

Annotations
@Override
overlapsback to summary
public boolean overlaps(long position, long size)

Implements io.vertx.core.file.AsyncFileLock.overlaps.

Returns:boolean

Doc from io.vertx.core.file.AsyncFileLock.overlaps.

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

Annotations
@Override
positionback to summary
public long position()

Implements io.vertx.core.file.AsyncFileLock.position.

Returns:long

Doc from io.vertx.core.file.AsyncFileLock.position.

the position of the first byte of the locked region

Annotations
@Override
releaseback to summary
public Future<Void> release()

Implements io.vertx.core.file.AsyncFileLock.release.

Doc from io.vertx.core.file.AsyncFileLock.release.

Releases this lock;

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

Implements io.vertx.core.file.AsyncFileLock.release.

Doc from io.vertx.core.file.AsyncFileLock.release.

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

Annotations
@Override
releaseBlockingback to summary
public void releaseBlocking()

Implements io.vertx.core.file.AsyncFileLock.releaseBlocking.

Doc from io.vertx.core.file.AsyncFileLock.releaseBlocking.

Like release() but blocking.

Annotations
@Override
sizeback to summary
public long size()

Implements io.vertx.core.file.AsyncFileLock.size.

Returns:long

Doc from io.vertx.core.file.AsyncFileLock.size.

the size in bytes of the locked region

Annotations
@Override