com.atlassian.beehive
Class DatabaseClusterLockService
java.lang.Object
com.atlassian.beehive.DatabaseClusterLockService
- All Implemented Interfaces:
- ClusterLockService
public class DatabaseClusterLockService
- extends java.lang.Object
- implements ClusterLockService
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.
Applications whose dependency injection container does not support the JSR-250
PostConstruct
annotation will need to explicitly invoke
the cleanUpOrphanLocks()
method upon startup.
- See Also:
SimpleClusterLockService
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatabaseClusterLockService
public DatabaseClusterLockService(ClusterLockDao clusterLockDao,
ClusterNodeHeartBeatDao clusterNodeHeartBeatDao)
cleanUpOrphanLocks
@PostConstruct
public void cleanUpOrphanLocks()
getLockForName
public ClusterLock getLockForName(@Nonnull
java.lang.String lockName)
- Description copied from interface:
ClusterLockService
- Returns the cluster-wide lock for the given name.
- Specified by:
getLockForName
in interface ClusterLockService
- Parameters:
lockName
- the globally unique lock identifier
- Returns:
- the cluster-wide lock for the given name.
Copyright © 2014 Atlassian. All Rights Reserved.