use of com.hazelcast.cp.internal.datastructures.lock.proxy.FencedLockProxy in project hazelcast by hazelcast.
the class LockService method createProxy.
@Override
public FencedLock createProxy(String proxyName) {
proxyName = withoutDefaultGroupName(proxyName);
while (true) {
FencedLockProxy proxy = proxies.get(proxyName);
if (proxy != null) {
CPGroupId groupId = raftService.createRaftGroupForProxy(proxyName);
if (!proxy.getGroupId().equals(groupId)) {
proxies.remove(proxyName, proxy);
} else {
return proxy;
}
}
proxy = doCreateProxy(proxyName);
FencedLockProxy existing = proxies.putIfAbsent(proxyName, proxy);
if (existing == null) {
return proxy;
}
}
}
Aggregations