mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
extract dubbo spring cloud remove methods
This commit is contained in:
parent
85435b9acb
commit
97528396fd
@ -297,12 +297,15 @@ public class DubboServiceMetadataRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the metadata of Dubbo Services if no there is no service instance.
|
* Remove the metadata and initialized service of Dubbo Services if no there is no
|
||||||
|
* service instance.
|
||||||
* @param serviceName the service name
|
* @param serviceName the service name
|
||||||
*/
|
*/
|
||||||
public void removeInitializedService(String serviceName) {
|
public void removeMetadataAndInitializedService(String serviceName) {
|
||||||
synchronized (monitor) {
|
synchronized (monitor) {
|
||||||
initializedServices.remove(serviceName);
|
initializedServices.remove(serviceName);
|
||||||
|
dubboRestServiceMetadataRepository.remove(serviceName);
|
||||||
|
subscribedDubboMetadataServiceURLs.remove(serviceName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -644,11 +647,6 @@ public class DubboServiceMetadataRepository
|
|||||||
dubboMetadataConfigServiceProxy.initProxy(serviceName, version);
|
dubboMetadataConfigServiceProxy.initProxy(serviceName, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeMetadata(String serviceName) {
|
|
||||||
dubboRestServiceMetadataRepository.remove(serviceName);
|
|
||||||
subscribedDubboMetadataServiceURLs.remove(serviceName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setApplicationEventPublisher(
|
public void setApplicationEventPublisher(
|
||||||
ApplicationEventPublisher applicationEventPublisher) {
|
ApplicationEventPublisher applicationEventPublisher) {
|
||||||
|
@ -224,8 +224,7 @@ public abstract class AbstractSpringCloudRegistry extends FailbackRegistry {
|
|||||||
|
|
||||||
if (CollectionUtils.isEmpty(serviceInstances)) {
|
if (CollectionUtils.isEmpty(serviceInstances)) {
|
||||||
dubboMetadataConfigServiceProxy.removeProxy(serviceName);
|
dubboMetadataConfigServiceProxy.removeProxy(serviceName);
|
||||||
repository.removeInitializedService(serviceName);
|
repository.removeMetadataAndInitializedService(serviceName);
|
||||||
repository.removeMetadata(serviceName);
|
|
||||||
dubboGenericServiceFactory.destroy(serviceName);
|
dubboGenericServiceFactory.destroy(serviceName);
|
||||||
if (logger.isWarnEnabled()) {
|
if (logger.isWarnEnabled()) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user