Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dubbo-6720] fix bug same interface unexport and export fail. also support hotload service #6720

Merged
merged 14 commits into from Jun 15, 2021
Expand Up @@ -19,6 +19,7 @@
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.ConcurrentHashSet;
import org.apache.dubbo.remoting.Constants;
import org.apache.dubbo.rpc.Exporter;
Expand All @@ -42,7 +43,7 @@
/**
* abstract ProtocolSupport.
*/
public abstract class AbstractProtocol implements Protocol {
public abstract class AbstractProtocol implements DelegateExporterMap, Protocol {
owen200008 marked this conversation as resolved.
Show resolved Hide resolved

protected final Logger logger = LoggerFactory.getLogger(getClass());

Expand Down Expand Up @@ -110,7 +111,34 @@ public Map<String, Exporter<?>> getExporterMap() {
return exporterMap;
}

@Override
public Collection<Exporter<?>> getExporters() {
return Collections.unmodifiableCollection(exporterMap.values());
}

@Override
public boolean isEmpty() {
return CollectionUtils.isEmptyMap(exporterMap);
}

@Override
public Exporter<?> getExport(String key) {
return exporterMap.get(key);
}

@Override
public void addExportMap(String key, Exporter<?> exporter) {
exporterMap.put(key, exporter);
}

/**
* mgr exporterMap self, don't give to DubboExporter or InjvmExporter
*/
@Override
public void removeExportMap(String key, Exporter<?> exporter) {
Exporter<?> findExporter = exporterMap.get(key);
if(findExporter == exporter){
exporterMap.remove(key);
}
}
}