Class FileBasedLockManager

  • All Implemented Interfaces:
    AutoCloseable, org.apache.activemq.artemis.lockmanager.DistributedLockManager

    public class FileBasedLockManager
    extends Object
    implements org.apache.activemq.artemis.lockmanager.DistributedLockManager
    This is an implementation suitable to be used just on unit tests and it won't attempt to manage nor purge existing stale locks files. It's part of the tests life-cycle to properly set-up and tear-down the environment.
    • Constructor Detail

      • FileBasedLockManager

        public FileBasedLockManager​(Map<String,​String> args)
      • FileBasedLockManager

        public FileBasedLockManager​(File locksFolder)
    • Method Detail

      • isStarted

        public boolean isStarted()
        Specified by:
        isStarted in interface org.apache.activemq.artemis.lockmanager.DistributedLockManager
      • addUnavailableManagerListener

        public void addUnavailableManagerListener​(org.apache.activemq.artemis.lockmanager.DistributedLockManager.UnavailableManagerListener listener)
        Specified by:
        addUnavailableManagerListener in interface org.apache.activemq.artemis.lockmanager.DistributedLockManager
      • removeUnavailableManagerListener

        public void removeUnavailableManagerListener​(org.apache.activemq.artemis.lockmanager.DistributedLockManager.UnavailableManagerListener listener)
        Specified by:
        removeUnavailableManagerListener in interface org.apache.activemq.artemis.lockmanager.DistributedLockManager
      • stop

        public void stop()
        Specified by:
        stop in interface org.apache.activemq.artemis.lockmanager.DistributedLockManager
      • getDistributedLock

        public org.apache.activemq.artemis.lockmanager.DistributedLock getDistributedLock​(String lockId)
                                                                                   throws ExecutionException
        Specified by:
        getDistributedLock in interface org.apache.activemq.artemis.lockmanager.DistributedLockManager
        Throws:
        ExecutionException
      • getMutableLong

        public org.apache.activemq.artemis.lockmanager.MutableLong getMutableLong​(String mutableLongId)
                                                                           throws ExecutionException
        Specified by:
        getMutableLong in interface org.apache.activemq.artemis.lockmanager.DistributedLockManager
        Throws:
        ExecutionException