Modifier and Type | Field and Description |
---|---|
private File |
file |
private FileChannel |
fileChannel |
private Map<Thread,AtomicInteger> |
fileClients |
private FileLock |
fileLock |
private RandomAccessFile |
randomAccessFile |
private AtomicBoolean |
write |
Constructor and Description |
---|
Lock(File file) |
Lock(File file,
boolean write) |
Modifier and Type | Method and Description |
---|---|
void |
addFileClient(Thread thread) |
protected void |
close() |
private void |
closeQuietly(Closeable closeable) |
File |
getFile() |
Map<Thread,AtomicInteger> |
getFileClients() |
protected RandomAccessFile |
getRandomAccessFile() |
boolean |
isShared() |
boolean |
isValid() |
AtomicBoolean |
isWrite() |
protected void |
openLock(boolean write,
boolean timeout) |
boolean |
removeFileClient(Thread thread) |
void |
setFile(File file) |
void |
setWrite(boolean write) |
String |
toString() |
private AtomicBoolean write
private final Map<Thread,AtomicInteger> fileClients
private RandomAccessFile randomAccessFile
private FileChannel fileChannel
public Lock(File file, boolean write) throws FileNotFoundException
FileNotFoundException
public AtomicBoolean isWrite()
public void setWrite(boolean write)
public boolean isShared()
public boolean isValid()
public Map<Thread,AtomicInteger> getFileClients()
public void addFileClient(Thread thread)
public boolean removeFileClient(Thread thread)
protected void close() throws IOException
IOException
protected void openLock(boolean write, boolean timeout) throws IOException
IOException
protected RandomAccessFile getRandomAccessFile()
private void closeQuietly(Closeable closeable)
Copyright © 2006–2023 The Apache Software Foundation. All rights reserved.