use of com.networknt.status.Status in project light-4j by networknt.
the class ZooKeeperRegistry method unsubscribeService.
@Override
protected void unsubscribeService(URL url, ServiceListener serviceListener) {
try {
clientLock.lock();
Map<ServiceListener, IZkChildListener> childChangeListeners = serviceListeners.get(url);
if (childChangeListeners != null) {
IZkChildListener zkChildListener = childChangeListeners.get(serviceListener);
if (zkChildListener != null) {
client.unsubscribeChildChanges(ZkUtils.toNodeTypePath(url, ZkNodeType.CLIENT), zkChildListener);
childChangeListeners.remove(serviceListener);
}
}
} catch (Throwable e) {
throw new FrameworkException(new Status(UNSUBSCRIBE_ZOOKEEPER_SERVICE_ERROR, url, getUrl(), e.getMessage()), e);
} finally {
clientLock.unlock();
}
}
Aggregations