Class FileBasedPrimitiveManager

  • All Implemented Interfaces:
    AutoCloseable, org.apache.activemq.artemis.quorum.DistributedPrimitiveManager

    public class FileBasedPrimitiveManager
    extends Object
    implements org.apache.activemq.artemis.quorum.DistributedPrimitiveManager
    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

      • FileBasedPrimitiveManager

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

        public FileBasedPrimitiveManager​(File locksFolder)
    • Method Detail

      • isStarted

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

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

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

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

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

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