public class Lock extends Object implements Closeable
| Constructor and Description |
|---|
Lock(Path file) |
Lock(Path file,
boolean write) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFileClient(Thread thread) |
void |
close() |
Path |
getFile() |
Map<Thread,AtomicInteger> |
getFileClients() |
boolean |
isShared() |
boolean |
isValid() |
AtomicBoolean |
isWrite() |
protected void |
openLock(boolean write,
boolean timeout) |
boolean |
removeFileClient(Thread thread) |
void |
setFile(Path file) |
void |
setWrite(boolean write) |
String |
toString() |
public Lock(Path file, boolean write) throws IOException
IOExceptionpublic 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)
public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected void openLock(boolean write, boolean timeout) throws IOException
IOExceptionCopyright © 2006–2019 The Apache Software Foundation. All rights reserved.