public class DatabaseClusterLockService extends Object implements ManagedClusterLockService
This implementation relies on the host application providing SPI implementations for Data Access objects.
| Constructor and Description |
|---|
DatabaseClusterLockService(ClusterLockDao clusterLockDao) |
| Modifier and Type | Method and Description |
|---|---|
Collection<com.atlassian.beehive.db.DatabaseClusterLock> |
getAllKnownClusterLocks()
Returns all the cluster locks that are currently known to this cluster lock service.
|
ClusterLock |
getLockForName(String lockName)
Returns the cluster-wide lock for the given name.
|
Collection<ClusterLockStatus> |
getStatusesOfAllHeldClusterLocks()
Returns lock status of every cluster lock being held.
|
void |
onDbErased()
Notify the service about removal of any records in tables used by SPI dao implementations during runtime.
|
void |
shutdown() |
public DatabaseClusterLockService(ClusterLockDao clusterLockDao)
public Collection<com.atlassian.beehive.db.DatabaseClusterLock> getAllKnownClusterLocks()
ManagedClusterLockServiceThe specifics are mostly left up to the implementation, with the following caveats:
Consumers MUST NOT rely on this method for the correctness of their locking behaviour. This information is intended for instrumentation and other similar management concerns, only.
getAllKnownClusterLocks in interface ManagedClusterLockService@Nonnull public Collection<ClusterLockStatus> getStatusesOfAllHeldClusterLocks()
ManagedClusterLockServiceThis is intended to provide additional information about misbehaving locks and thus this method should return the most up-to-date and non-cached data.
Consumers must be aware that not all implementations can return a valid update time of the locks.
getStatusesOfAllHeldClusterLocks in interface ManagedClusterLockServicepublic ClusterLock getLockForName(@Nonnull String lockName)
ClusterLockServicegetLockForName in interface ClusterLockServicelockName - the globally unique lock identifier@PreDestroy public void shutdown()
public void onDbErased()
Copyright © 2019 Atlassian. All rights reserved.