Class LockManagerImpl

java.lang.Object
org.flowable.common.engine.impl.lock.LockManagerImpl
All Implemented Interfaces:
LockManager

public class LockManagerImpl extends Object implements LockManager
Author:
Filip Hrisafov
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
    • LOCK_NAME_MAX_LENGTH

      protected static final int LOCK_NAME_MAX_LENGTH
      See Also:
    • commandExecutor

      protected CommandExecutor commandExecutor
    • lockName

      protected String lockName
    • lockPollRate

      protected Duration lockPollRate
    • engineType

      protected String engineType
    • lockCommandConfig

      protected CommandConfig lockCommandConfig
    • hasAcquiredLock

      protected boolean hasAcquiredLock
    • lockForceAcquireAfter

      protected Duration lockForceAcquireAfter
  • Constructor Details

  • Method Details

    • waitForLock

      public void waitForLock(Duration waitTime)
      Description copied from interface: LockManager
      Wait for the given waitTime to acquire the lock
      Specified by:
      waitForLock in interface LockManager
      Parameters:
      waitTime - the duration to wait before throwing an exception
    • acquireLock

      public boolean acquireLock()
      Description copied from interface: LockManager
      Acquire the lock.
      Specified by:
      acquireLock in interface LockManager
      Returns:
      true if the lock was acquired, false otherwise
    • acquireLock

      public boolean acquireLock(Duration lockForceAcquireAfter)
      Description copied from interface: LockManager
      Acquire the lock. The lockForceAcquireAfter will be used to acquire an expired lock
      Specified by:
      acquireLock in interface LockManager
      Parameters:
      lockForceAcquireAfter - the amount of time after which the lock should be acquired
      Returns:
      true if the lock was acquired, false otherwise
    • releaseLock

      public void releaseLock()
      Description copied from interface: LockManager
      Release the lock.
      Specified by:
      releaseLock in interface LockManager
    • releaseAndDeleteLock

      public void releaseAndDeleteLock()
      Description copied from interface: LockManager
      Release the lock and delete the resources for the lock if needed.
      Specified by:
      releaseAndDeleteLock in interface LockManager
    • waitForLockRunAndRelease

      public <T> T waitForLockRunAndRelease(Duration waitTime, Supplier<T> supplier)
      Description copied from interface: LockManager
      Wait to acquire a lock, once a lock is acquired execute the supplier and release finally the lock.
      Specified by:
      waitForLockRunAndRelease in interface LockManager
      Parameters:
      waitTime - the duration to wait before throwing an exception
      supplier - the supplier to be executed once the lock is acquired
      Returns:
      the result from the supplier
    • executeCommand

      protected <T> T executeCommand(Command<T> command)
    • getLockPollRate

      protected Duration getLockPollRate()