org.usergrid.locking.zookeeper
Class ZooKeeperLockManagerImpl
java.lang.Object
org.usergrid.locking.zookeeper.ZooKeeperLockManagerImpl
- All Implemented Interfaces:
- LockManager
public final class ZooKeeperLockManagerImpl
- extends Object
- implements LockManager
Implementation for Zookeeper service that handles global locks.
Field Summary |
protected static org.slf4j.Logger |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static final org.slf4j.Logger logger
ZooKeeperLockManagerImpl
public ZooKeeperLockManagerImpl(String hostPort,
int sessionTimeout,
int maxAttemps)
ZooKeeperLockManagerImpl
public ZooKeeperLockManagerImpl()
init
@PostConstruct
public void init()
createLock
public Lock createLock(UUID applicationId,
String... path)
throws UGLockException
- Description copied from interface:
LockManager
- Acquires a lock on a particular path.
- Specified by:
createLock
in interface LockManager
- Parameters:
applicationId
- application UUIDpath
- a unique path
- Throws:
UGLockException
- if the lock cannot be acquired
getHostPort
public String getHostPort()
setHostPort
public void setHostPort(String hostPort)
getSessionTimeout
public int getSessionTimeout()
setSessionTimeout
public void setSessionTimeout(int sessionTimeout)
getMaxAttempts
public int getMaxAttempts()
setMaxAttempts
public void setMaxAttempts(int maxAttemps)
Copyright © 2013. All Rights Reserved.