public class ResourceLockManagerEtcdImpl extends Object implements ResourceLockManager
| Constructor and Description |
|---|
ResourceLockManagerEtcdImpl(org.zalando.boot.etcd.EtcdClient etcdClient,
String applicationName)
Creates a new ResourceLockManagerEtcdImpl with the given etcd client and
application name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquireLock(String resourceName,
String lockName)
Acquires a lock for the given resource name using the given lock name.
|
boolean |
acquireLock(String resourceName,
String lockName,
int ttl)
Acquires a lock for the given resource name using the given lock name.
|
void |
releaseLock(String resourceName,
String lockName)
Releases a lock for the given resource name using the given lock name.
|
public ResourceLockManagerEtcdImpl(org.zalando.boot.etcd.EtcdClient etcdClient,
String applicationName)
etcdClient - the etcd clientapplicationName - the application namepublic boolean acquireLock(String resourceName, String lockName)
ResourceLockManageracquireLock in interface ResourceLockManagerresourceName - the resource name to be locked onlockName - the name of the locktrue if the lock was acquired, false
otherwisepublic boolean acquireLock(String resourceName, String lockName, int ttl)
ResourceLockManageracquireLock in interface ResourceLockManagerresourceName - the resource name to be locked onlockName - the name of the lockttl - the time the lock exists in secondstrue if the lock was acquired, false
otherwisepublic void releaseLock(String resourceName, String lockName)
ResourceLockManagerreleaseLock in interface ResourceLockManagerresourceName - the resource name to be locked onlockName - the name of the lockCopyright © 2017 Zalando SE. All rights reserved.