Class FileBasedPrimitiveManager
- java.lang.Object
-
- org.apache.activemq.artemis.quorum.file.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 Summary
Constructors Constructor Description FileBasedPrimitiveManager(File locksFolder)FileBasedPrimitiveManager(Map<String,String> args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUnavailableManagerListener(org.apache.activemq.artemis.quorum.DistributedPrimitiveManager.UnavailableManagerListener listener)org.apache.activemq.artemis.quorum.DistributedLockgetDistributedLock(String lockId)org.apache.activemq.artemis.quorum.MutableLonggetMutableLong(String mutableLongId)booleanisStarted()voidremoveUnavailableManagerListener(org.apache.activemq.artemis.quorum.DistributedPrimitiveManager.UnavailableManagerListener listener)voidstart()booleanstart(long timeout, TimeUnit unit)voidstop()
-
-
-
Method Detail
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceorg.apache.activemq.artemis.quorum.DistributedPrimitiveManager
-
addUnavailableManagerListener
public void addUnavailableManagerListener(org.apache.activemq.artemis.quorum.DistributedPrimitiveManager.UnavailableManagerListener listener)
- Specified by:
addUnavailableManagerListenerin interfaceorg.apache.activemq.artemis.quorum.DistributedPrimitiveManager
-
removeUnavailableManagerListener
public void removeUnavailableManagerListener(org.apache.activemq.artemis.quorum.DistributedPrimitiveManager.UnavailableManagerListener listener)
- Specified by:
removeUnavailableManagerListenerin interfaceorg.apache.activemq.artemis.quorum.DistributedPrimitiveManager
-
start
public boolean start(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException- Specified by:
startin interfaceorg.apache.activemq.artemis.quorum.DistributedPrimitiveManager- Throws:
InterruptedExceptionExecutionException
-
start
public void start() throws InterruptedException, ExecutionException- Specified by:
startin interfaceorg.apache.activemq.artemis.quorum.DistributedPrimitiveManager- Throws:
InterruptedExceptionExecutionException
-
stop
public void stop()
- Specified by:
stopin interfaceorg.apache.activemq.artemis.quorum.DistributedPrimitiveManager
-
getDistributedLock
public org.apache.activemq.artemis.quorum.DistributedLock getDistributedLock(String lockId) throws ExecutionException
- Specified by:
getDistributedLockin interfaceorg.apache.activemq.artemis.quorum.DistributedPrimitiveManager- Throws:
ExecutionException
-
getMutableLong
public org.apache.activemq.artemis.quorum.MutableLong getMutableLong(String mutableLongId) throws ExecutionException
- Specified by:
getMutableLongin interfaceorg.apache.activemq.artemis.quorum.DistributedPrimitiveManager- Throws:
ExecutionException
-
-