mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Polish alibaba/spring-cloud-alibaba#1369 : [Feature] Synchronizing source code to Spring Cloud Alibaba greenwich branch
This commit is contained in:
parent
0f05d78c37
commit
8f5da177bc
@ -34,8 +34,8 @@ import org.springframework.core.env.PropertySource;
|
|||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_PROTOCOL;
|
|
||||||
import static com.alibaba.spring.util.PropertySourcesUtils.getSubProperties;
|
import static com.alibaba.spring.util.PropertySourcesUtils.getSubProperties;
|
||||||
|
import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_PROTOCOL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dubbo {@link WebApplicationType#NONE Non-Web Application}
|
* Dubbo {@link WebApplicationType#NONE Non-Web Application}
|
||||||
@ -84,7 +84,7 @@ public class DubboNonWebApplicationEnvironmentPostProcessor
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postProcessEnvironment(ConfigurableEnvironment environment,
|
public void postProcessEnvironment(ConfigurableEnvironment environment,
|
||||||
SpringApplication application) {
|
SpringApplication application) {
|
||||||
WebApplicationType webApplicationType = application.getWebApplicationType();
|
WebApplicationType webApplicationType = application.getWebApplicationType();
|
||||||
|
|
||||||
if (!WebApplicationType.NONE.equals(webApplicationType)) { // Just works in
|
if (!WebApplicationType.NONE.equals(webApplicationType)) { // Just works in
|
||||||
@ -117,7 +117,7 @@ public class DubboNonWebApplicationEnvironmentPostProcessor
|
|||||||
* @param defaultProperties defaultProperties
|
* @param defaultProperties defaultProperties
|
||||||
*/
|
*/
|
||||||
private void resetServerPort(ConfigurableEnvironment environment,
|
private void resetServerPort(ConfigurableEnvironment environment,
|
||||||
Map<String, Object> defaultProperties) {
|
Map<String, Object> defaultProperties) {
|
||||||
|
|
||||||
String serverPort = environment.getProperty(SERVER_PORT_PROPERTY_NAME,
|
String serverPort = environment.getProperty(SERVER_PORT_PROPERTY_NAME,
|
||||||
environment.getProperty(PORT_PROPERTY_NAME));
|
environment.getProperty(PORT_PROPERTY_NAME));
|
||||||
@ -181,7 +181,7 @@ public class DubboNonWebApplicationEnvironmentPostProcessor
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setServerPort(ConfigurableEnvironment environment, String serverPort,
|
private void setServerPort(ConfigurableEnvironment environment, String serverPort,
|
||||||
Map<String, Object> defaultProperties) {
|
Map<String, Object> defaultProperties) {
|
||||||
if (serverPort == null) {
|
if (serverPort == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -196,7 +196,7 @@ public class DubboNonWebApplicationEnvironmentPostProcessor
|
|||||||
* @param map Default Dubbo Properties
|
* @param map Default Dubbo Properties
|
||||||
*/
|
*/
|
||||||
private void addOrReplace(MutablePropertySources propertySources,
|
private void addOrReplace(MutablePropertySources propertySources,
|
||||||
Map<String, Object> map) {
|
Map<String, Object> map) {
|
||||||
MapPropertySource target = null;
|
MapPropertySource target = null;
|
||||||
if (propertySources.contains(PROPERTY_SOURCE_NAME)) {
|
if (propertySources.contains(PROPERTY_SOURCE_NAME)) {
|
||||||
PropertySource<?> source = propertySources.get(PROPERTY_SOURCE_NAME);
|
PropertySource<?> source = propertySources.get(PROPERTY_SOURCE_NAME);
|
||||||
|
@ -689,5 +689,4 @@ public class DubboServiceMetadataRepository
|
|||||||
ApplicationEventPublisher applicationEventPublisher) {
|
ApplicationEventPublisher applicationEventPublisher) {
|
||||||
this.applicationEventPublisher = applicationEventPublisher;
|
this.applicationEventPublisher = applicationEventPublisher;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
@ -398,4 +398,4 @@ public abstract class AbstractSpringCloudRegistry extends FailbackRegistry {
|
|||||||
return DUBBO_METADATA_SERVICE_CLASS_NAME.equals(url.getServiceInterface());
|
return DUBBO_METADATA_SERVICE_CLASS_NAME.equals(url.getServiceInterface());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user