Package com.coditory.sherlock
Interface DistributedLock
-
- All Known Implementing Classes:
DistributedLockMock
public interface DistributedLock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
acquire()
boolean
acquire(java.time.Duration duration)
default boolean
acquireAndExecute(java.lang.Runnable action)
default boolean
acquireAndExecute(java.time.Duration duration, java.lang.Runnable action)
boolean
acquireForever()
default boolean
acquireForeverAndExecute(java.lang.Runnable action)
java.lang.String
getId()
boolean
release()
default boolean
releaseAndExecute(java.lang.Runnable action)
-
-
-
Method Detail
-
getId
java.lang.String getId()
-
acquire
boolean acquire()
-
acquire
boolean acquire(java.time.Duration duration)
-
acquireForever
boolean acquireForever()
-
release
boolean release()
-
acquireAndExecute
default boolean acquireAndExecute(java.lang.Runnable action)
-
acquireAndExecute
default boolean acquireAndExecute(java.time.Duration duration, java.lang.Runnable action)
-
acquireForeverAndExecute
default boolean acquireForeverAndExecute(java.lang.Runnable action)
-
releaseAndExecute
default boolean releaseAndExecute(java.lang.Runnable action)
-
-