Interface DomainObjectLockHold

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
DomainObjectLockHold.DefaultHold

public interface DomainObjectLockHold extends AutoCloseable
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
 }