public class DatabaseClusterLockService extends Object implements ManagedClusterLockService
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 and Description |
|---|
DatabaseClusterLockService(ClusterLockDao clusterLockDao) |
| Modifier and Type | Method and Description |
|---|---|
Collection<com.atlassian.beehive.db.DatabaseClusterLock> |
getAllKnownClusterLocks() |
ClusterLock |
getLockForName(String lockName) |
Collection<ClusterLockStatus> |
getStatusesOfAllHeldClusterLocks() |
void |
resetDatabaseState()
Reset internal state of the locks to adjust to external changes in tables used by DAO at runtime.
|
void |
shutdown() |
public DatabaseClusterLockService(ClusterLockDao clusterLockDao)
public Collection<com.atlassian.beehive.db.DatabaseClusterLock> getAllKnownClusterLocks()
getAllKnownClusterLocks in interface ManagedClusterLockService@Nonnull public Collection<ClusterLockStatus> getStatusesOfAllHeldClusterLocks()
getStatusesOfAllHeldClusterLocks in interface ManagedClusterLockServicepublic ClusterLock getLockForName(@Nonnull String lockName)
getLockForName in interface ClusterLockService@PreDestroy public void shutdown()
public void resetDatabaseState()
Copyright © 2020 Atlassian. All rights reserved.