|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.nio.channels.FileLock
public abstract class FileLock
Constructor Summary | |
---|---|
protected |
FileLock(FileChannel channel,
long position,
long size,
boolean shared)
Initializes the file lock. |
Method Summary | |
---|---|
FileChannel |
channel()
Returns the file channel upon whose file this lock is held. |
boolean |
isShared()
Tells whether this lock is shared. |
abstract boolean |
isValid()
Tells whether or not this lock is valid. |
boolean |
overlaps(long position,
long size)
Tells whether or not this lock overlaps the given lock range. |
long |
position()
Returns the position within the file of the first byte of the locked region. |
abstract void |
release()
Releases this lock. |
long |
size()
Returns the size of the locked region in bytes. |
String |
toString()
Returns a string describing the range, type, and validity of this lock. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected FileLock(FileChannel channel, long position, long size, boolean shared)
IllegalArgumentException
- If the preconditions on the parameters do not holdMethod Detail |
---|
public abstract boolean isValid()
public abstract void release() throws IOException
IOException
- If an error occurs
ClosedChannelException
- If the locked channel is no longer open.public final FileChannel channel()
public final boolean isShared()
public final boolean overlaps(long position, long size)
public final long position()
public final long size()
public final String toString()
toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |