Package dk.cloudcreate.essentials.components.foundation.fencedlock
package dk.cloudcreate.essentials.components.foundation.fencedlock
-
ClassDescriptionBase class for implementing persistent/durable
FencedLockManager'sCommon super base class for implementing persistent/durableFencedLockManager'sRepresents a named fenced lock, where theFencedLock.getCurrentToken()can be passed on to down stream logic, which can keep track of the token value to identify if a timed out lock is being used to request logic.
The fence locking concept is described here https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.htmlIs published on theLocalEventBuswhen aLifecycle.start()is called (and the lock manager isn't already started)Is published on theLocalEventBuswhen aLifecycle.stop()is called (and the lock manager isn't already stopped)This library provides a Distributed Locking Manager based of the Fenced Locking concept described here
TheFencedLockManageris responsible for obtaining and managing distributedFencedLock's, which are named exclusive locks.
Only oneFencedLockManagerinstance can acquire aFencedLockat a time.
The implementation has been on supporting intra-service (i.e.Contains the name of aFencedLock