Package pgp.cert_d
Interface PGPCertificateDirectory.LockingMechanism
-
- All Known Implementing Classes:
InMemoryCertificateDirectoryBackend.ObjectLockingMechanism
- Enclosing class:
- PGPCertificateDirectory
public static interface PGPCertificateDirectory.LockingMechanismInterface for a write-locking mechanism.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisLocked()Return true if the lock is in locked state.voidlockDirectory()Lock the store for writes.voidreleaseDirectory()Release the directory write-lock acquired vialockDirectory().booleantryLockDirectory()Try top lock the store for writes.
-
-
-
Method Detail
-
lockDirectory
void lockDirectory() throws java.io.IOException, java.lang.InterruptedExceptionLock the store for writes. Readers can continue to use the store and will always see consistent certs.- Throws:
java.io.IOException- in case of an IO errorjava.lang.InterruptedException- if the thread gets interrupted
-
tryLockDirectory
boolean tryLockDirectory() throws java.io.IOExceptionTry top lock the store for writes. Return false without locking the store in case the store was already locked.- Returns:
- true if locking succeeded, false otherwise
- Throws:
java.io.IOException- in case of an IO error
-
isLocked
boolean isLocked()
Return true if the lock is in locked state.- Returns:
- true if locked
-
releaseDirectory
void releaseDirectory() throws java.io.IOExceptionRelease the directory write-lock acquired vialockDirectory().- Throws:
java.io.IOException- in case of an IO error
-
-