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
|
||||
*/
|
||||
public void removeInitializedService(String serviceName) {
|
||||
public void removeMetadataAndInitializedService(String serviceName) {
|
||||
synchronized (monitor) {
|
||||
initializedServices.remove(serviceName);
|
||||
dubboRestServiceMetadataRepository.remove(serviceName);
|
||||
subscribedDubboMetadataServiceURLs.remove(serviceName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -644,11 +647,6 @@ public class DubboServiceMetadataRepository
|
||||
dubboMetadataConfigServiceProxy.initProxy(serviceName, version);
|
||||
}
|
||||
|
||||
public void removeMetadata(String serviceName) {
|
||||
dubboRestServiceMetadataRepository.remove(serviceName);
|
||||
subscribedDubboMetadataServiceURLs.remove(serviceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationEventPublisher(
|
||||
ApplicationEventPublisher applicationEventPublisher) {
|
||||
|
@ -224,8 +224,7 @@ public abstract class AbstractSpringCloudRegistry extends FailbackRegistry {
|
||||
|
||||
if (CollectionUtils.isEmpty(serviceInstances)) {
|
||||
dubboMetadataConfigServiceProxy.removeProxy(serviceName);
|
||||
repository.removeInitializedService(serviceName);
|
||||
repository.removeMetadata(serviceName);
|
||||
repository.removeMetadataAndInitializedService(serviceName);
|
||||
dubboGenericServiceFactory.destroy(serviceName);
|
||||
if (logger.isWarnEnabled()) {
|
||||
logger.warn(
|
||||
|
Loading…
x
Reference in New Issue
Block a user