extract dubbo spring cloud remove methods

pull/1195/head^2
fangjian0423 5 years ago
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…
Cancel
Save