Package com.atlassian.beehive.db
Class DatabaseClusterLockService
java.lang.Object
com.atlassian.beehive.db.DatabaseClusterLockService
- All Implemented Interfaces:
ClusterLockService,ManagedClusterLockService
This is the database backed implementation of ClusterLockService that can be used by clustered applications.
This implementation relies on the host application providing SPI implementations for Data Access objects.
Warning: Any alterations of tables used by DAO SPI implementations, if performed at runtime, need to be followed by callingresetDatabaseState().
Failing to do so immediately after the changes, may result in unexpected locks behavior.
Furthermore, the existing unreleased locks, that were held since before the db alteration, no logner guarantee clusterwide exclusiveness until they are successfully reacquired.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<com.atlassian.beehive.db.DatabaseClusterLock>getLockForName(String lockName) voidReset internal state of the locks to adjust to external changes in tables used by DAO at runtime.voidshutdown()
-
Constructor Details
-
DatabaseClusterLockService
-
-
Method Details
-
getAllKnownClusterLocks
- Specified by:
getAllKnownClusterLocksin interfaceManagedClusterLockService
-
getStatusesOfAllHeldClusterLocks
- Specified by:
getStatusesOfAllHeldClusterLocksin interfaceManagedClusterLockService
-
getLockForName
- Specified by:
getLockForNamein interfaceClusterLockService
-
shutdown
-
resetDatabaseState
public void resetDatabaseState()Reset internal state of the locks to adjust to external changes in tables used by DAO at runtime.
-