Package ghidra.util.database
Interface DomainObjectLockHold
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DomainObjectLockHold.DefaultHold
A hold on the lock for a domain object, obtained via
lock(DomainObject, String) or
forceLock(DomainObject, boolean, String)
This is designed for use in a try-with-resources block to ensure the timely release of
the lock even in exceptional conditions, as in:
try (DomainObjectLockHold hold = DomainObjectLockHold.lock("Demonstration")) {
// Do stuff while holding the lock
}
-
Nested Class Summary
Nested Classes -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic DomainObjectLockHoldforceLock(DomainObject object, boolean rollback, String reason) Wrapper forDomainObject.forceLock(boolean, String)static DomainObjectLockHoldlock(DomainObject object, String reason) Wrapper forDomainObject.lock(String)Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
lock
Wrapper forDomainObject.lock(String)- Parameters:
object- the objectreason- as inDomainObject.lock(String)- Returns:
- the hold, which should be used in a
try-with-resourcesblock - Throws:
DomainObjectLockedException- if the lock could not be obtained
-
forceLock
Wrapper forDomainObject.forceLock(boolean, String)- Parameters:
object- the objectrollback- as inDomainObject.forceLock(boolean, String)reason- as inDomainObject.forceLock(boolean, String)- Returns:
- the hold, which should be used in a
try-with-resourcesblock
-