public class FileLockAccessGuard extends Object implements IAccessGuard
| Constructor and Description |
|---|
FileLockAccessGuard(RandomAccessFile raf) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquire() |
boolean |
isValid()
checks if the lock is still valid
|
boolean |
release()
Gibt einen via
IAccessGuard.acquire() erzielten exklusiven Zugriff auf
eine Resource wieder frei. |
public FileLockAccessGuard(RandomAccessFile raf)
public void acquire()
throws InterruptedException,
TimeoutException,
IOException
acquire in interface IAccessGuardInterruptedExceptionTimeoutExceptionIOExceptionpublic boolean isValid()
IAccessGuardisValid in interface IAccessGuardpublic boolean release()
throws IOException
IAccessGuardIAccessGuard.acquire() erzielten exklusiven Zugriff auf
eine Resource wieder frei.
Falls niemand die aktuelle Ressource geblockt hat, so passiert nichts.
Falls der aktuelle Thread nicht den Zugriff auf die Ressource hat,
so wird eine Exception geworfen.release in interface IAccessGuardIOExceptionReentrantLock.unlock()Copyright © 2017. All rights reserved.