Map<String, ProtocolConfig> protocolConfigMap = applicationContext == null ? null : applicationContext.getBeansOfType(ProtocolConfig.class, false, false);
if (protocolConfigMap != null && protocolConfigMap.size() > 0) {
if (protocolConfigMap.size() > 1) {
throw new IllegalStateException("Found multi-protocols: " + protocolConfigMap.values() + ", You must be set default protocol in: <dubbo:provider protocol=\"dubbo\" />, or set service protocol in: <dubbo:service protocol=\"dubbo\" />");
}
ProtocolConfig protocolConfig = protocolConfigMap.values().iterator().next();
setProtocol(protocolConfig);
}
}
if (getPath() == null || getPath().length() == 0) {
if (beanName != null && beanName.length() > 0