@ThreadSafe public final class FileBasedLock extends Object implements Lock, Closeable
| Modifier and Type | Field and Description | 
|---|---|
static FileAttribute<?>[] | 
NO_FILE_ATTRS  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
close()
will release lock if owned, will not nothing if not owned. 
 | 
static Set<PosixFilePermission> | 
extractPosixPermissions(FileAttribute<?>[] fileAttributes)  | 
protected void | 
finalize()  | 
static String | 
getContextInfo()  | 
int | 
getLocalHoldCount()  | 
static FileBasedLock | 
getLock(File lockFile)  | 
static FileBasedLock | 
getLock(File lockFile,
       FileAttribute<?>... fileAttributes)
Returns a FileBasedLock implementation. 
 | 
boolean | 
isHeldByCurrentThread()  | 
void | 
lock()  | 
void | 
lockInterruptibly()  | 
Condition | 
newCondition()  | 
String | 
toString()  | 
boolean | 
tryLock()  | 
boolean | 
tryLock(long time,
       TimeUnit unit)  | 
void | 
unlock()  | 
public static final FileAttribute<?>[] NO_FILE_ATTRS
public static Set<PosixFilePermission> extractPosixPermissions(FileAttribute<?>[] fileAttributes)
public static FileBasedLock getLock(File lockFile, FileAttribute<?>... fileAttributes) throws IOException
lockFile - the file to lock on.IOExceptionpublic static FileBasedLock getLock(File lockFile) throws IOException
IOExceptionpublic void lockInterruptibly()
                       throws InterruptedException
lockInterruptibly in interface LockInterruptedExceptionpublic boolean tryLock(long time,
                       TimeUnit unit)
                throws InterruptedException
tryLock in interface LockInterruptedExceptionpublic Condition newCondition()
newCondition in interface Lock@WillClose public void close()
close in interface Closeableclose in interface AutoCloseableprotected void finalize()
                 throws Throwable
public static String getContextInfo()
public int getLocalHoldCount()
public boolean isHeldByCurrentThread()
Copyright © 2018 SPF4J. All rights reserved.