提交 2cb97b56 编写于 作者: W william.liangf

DUBBO-375 修改redis注册中心适应新的registry契约

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@1708 1a56cb94-b969-4eaa-88fa-be21384802f2
上级 95096f35
......@@ -472,13 +472,13 @@ public abstract class AbstractRegistry implements Registry {
}
Set<URL> destroyRegistered = new HashSet<URL>(getRegistered());
if (! destroyRegistered.isEmpty()) {
if (logger.isInfoEnabled()) {
logger.info("Destroy unregister url " + destroyRegistered);
}
for (URL url : new HashSet<URL>(getRegistered())) {
if (url.getParameter(Constants.DYNAMIC_KEY, true)) {
try {
unregister(url);
if (logger.isInfoEnabled()) {
logger.info("Destroy unregister url " + url);
}
} catch (Throwable t) {
logger.warn("Failed to unregister url " + url + " to registry " + getUrl() + " on destroy, cause: " + t.getMessage(), t);
}
......@@ -487,14 +487,14 @@ public abstract class AbstractRegistry implements Registry {
}
Map<URL, Set<NotifyListener>> destroySubscribed = new HashMap<URL, Set<NotifyListener>>(getSubscribed());
if (! destroySubscribed.isEmpty()) {
if (logger.isInfoEnabled()) {
logger.info("Destroy unsubscribe url " + destroySubscribed.keySet());
}
for (Map.Entry<URL, Set<NotifyListener>> entry : destroySubscribed.entrySet()) {
URL url = entry.getKey();
for (NotifyListener listener : entry.getValue()) {
try {
unsubscribe(url, listener);
if (logger.isInfoEnabled()) {
logger.info("Destroy unsubscribe url " + url);
}
} catch (Throwable t) {
logger.warn("Failed to unsubscribe url " + url + " to registry " + getUrl() + " on destroy, cause: " +t.getMessage(), t);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册