forked from apache/dubbo-spring-boot-project
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polish apache#458 : dubbo.metadata-report.address propertie descripti…
…on not provided
- Loading branch information
1 parent
4c5d205
commit 49aef0b
Showing
7 changed files
with
298 additions
and
1,116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
288 changes: 288 additions & 0 deletions
288
...rc/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboConfigurationProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,288 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.dubbo.spring.boot.autoconfigure; | ||
|
||
import org.apache.dubbo.config.ApplicationConfig; | ||
import org.apache.dubbo.config.ConsumerConfig; | ||
import org.apache.dubbo.config.MetadataReportConfig; | ||
import org.apache.dubbo.config.ModuleConfig; | ||
import org.apache.dubbo.config.MonitorConfig; | ||
import org.apache.dubbo.config.ProtocolConfig; | ||
import org.apache.dubbo.config.ProviderConfig; | ||
import org.apache.dubbo.config.RegistryConfig; | ||
import org.apache.dubbo.config.spring.ConfigCenterBean; | ||
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.context.properties.NestedConfigurationProperty; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.LinkedHashSet; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import static org.apache.dubbo.spring.boot.util.DubboUtils.DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; | ||
import static org.apache.dubbo.spring.boot.util.DubboUtils.DUBBO_PREFIX; | ||
|
||
/** | ||
* Dubbo {@link ConfigurationProperties Config Properties} only used to generate JSON metadata(non-public class) | ||
* | ||
* @since 2.7.1 | ||
*/ | ||
@ConfigurationProperties(DUBBO_PREFIX) | ||
class DubboConfigurationProperties { | ||
|
||
@NestedConfigurationProperty | ||
private Config config = new Config(); | ||
|
||
@NestedConfigurationProperty | ||
private Scan scan = new Scan(); | ||
|
||
// Single Config Bindings | ||
|
||
private ApplicationConfig application = new ApplicationConfig(); | ||
|
||
private ModuleConfig module = new ModuleConfig(); | ||
|
||
private RegistryConfig registry = new RegistryConfig(); | ||
|
||
private ProtocolConfig protocol = new ProtocolConfig(); | ||
|
||
private MonitorConfig monitor = new MonitorConfig(); | ||
|
||
private ProviderConfig provider = new ProviderConfig(); | ||
|
||
private ConsumerConfig consumer = new ConsumerConfig(); | ||
|
||
private ConfigCenterBean configCenter = new ConfigCenterBean(); | ||
|
||
private MetadataReportConfig metadataReport = new MetadataReportConfig(); | ||
|
||
// Multiple Config Bindings | ||
|
||
private Map<String, ApplicationConfig> applications = new LinkedHashMap<>(); | ||
|
||
private Map<String, ModuleConfig> modules = new LinkedHashMap<>(); | ||
|
||
private Map<String, RegistryConfig> registrys = new LinkedHashMap<>(); | ||
|
||
private Map<String, ProtocolConfig> protocols = new LinkedHashMap<>(); | ||
|
||
private Map<String, MonitorConfig> monitors = new LinkedHashMap<>(); | ||
|
||
private Map<String, ProviderConfig> providers = new LinkedHashMap<>(); | ||
|
||
private Map<String, ConsumerConfig> consumers = new LinkedHashMap<>(); | ||
|
||
private Map<String, ConfigCenterBean> configCenters = new LinkedHashMap<>(); | ||
|
||
private Map<String, MetadataReportConfig> metadataReports = new LinkedHashMap<>(); | ||
|
||
public Config getConfig() { | ||
return config; | ||
} | ||
|
||
public void setConfig(Config config) { | ||
this.config = config; | ||
} | ||
|
||
public Scan getScan() { | ||
return scan; | ||
} | ||
|
||
public void setScan(Scan scan) { | ||
this.scan = scan; | ||
} | ||
|
||
public ApplicationConfig getApplication() { | ||
return application; | ||
} | ||
|
||
public void setApplication(ApplicationConfig application) { | ||
this.application = application; | ||
} | ||
|
||
public ModuleConfig getModule() { | ||
return module; | ||
} | ||
|
||
public void setModule(ModuleConfig module) { | ||
this.module = module; | ||
} | ||
|
||
public RegistryConfig getRegistry() { | ||
return registry; | ||
} | ||
|
||
public void setRegistry(RegistryConfig registry) { | ||
this.registry = registry; | ||
} | ||
|
||
public ProtocolConfig getProtocol() { | ||
return protocol; | ||
} | ||
|
||
public void setProtocol(ProtocolConfig protocol) { | ||
this.protocol = protocol; | ||
} | ||
|
||
public MonitorConfig getMonitor() { | ||
return monitor; | ||
} | ||
|
||
public void setMonitor(MonitorConfig monitor) { | ||
this.monitor = monitor; | ||
} | ||
|
||
public ProviderConfig getProvider() { | ||
return provider; | ||
} | ||
|
||
public void setProvider(ProviderConfig provider) { | ||
this.provider = provider; | ||
} | ||
|
||
public ConsumerConfig getConsumer() { | ||
return consumer; | ||
} | ||
|
||
public void setConsumer(ConsumerConfig consumer) { | ||
this.consumer = consumer; | ||
} | ||
|
||
public ConfigCenterBean getConfigCenter() { | ||
return configCenter; | ||
} | ||
|
||
public void setConfigCenter(ConfigCenterBean configCenter) { | ||
this.configCenter = configCenter; | ||
} | ||
|
||
public MetadataReportConfig getMetadataReport() { | ||
return metadataReport; | ||
} | ||
|
||
public void setMetadataReport(MetadataReportConfig metadataReport) { | ||
this.metadataReport = metadataReport; | ||
} | ||
|
||
public Map<String, ApplicationConfig> getApplications() { | ||
return applications; | ||
} | ||
|
||
public void setApplications(Map<String, ApplicationConfig> applications) { | ||
this.applications = applications; | ||
} | ||
|
||
public Map<String, ModuleConfig> getModules() { | ||
return modules; | ||
} | ||
|
||
public void setModules(Map<String, ModuleConfig> modules) { | ||
this.modules = modules; | ||
} | ||
|
||
public Map<String, RegistryConfig> getRegistrys() { | ||
return registrys; | ||
} | ||
|
||
public void setRegistrys(Map<String, RegistryConfig> registrys) { | ||
this.registrys = registrys; | ||
} | ||
|
||
public Map<String, ProtocolConfig> getProtocols() { | ||
return protocols; | ||
} | ||
|
||
public void setProtocols(Map<String, ProtocolConfig> protocols) { | ||
this.protocols = protocols; | ||
} | ||
|
||
public Map<String, MonitorConfig> getMonitors() { | ||
return monitors; | ||
} | ||
|
||
public void setMonitors(Map<String, MonitorConfig> monitors) { | ||
this.monitors = monitors; | ||
} | ||
|
||
public Map<String, ProviderConfig> getProviders() { | ||
return providers; | ||
} | ||
|
||
public void setProviders(Map<String, ProviderConfig> providers) { | ||
this.providers = providers; | ||
} | ||
|
||
public Map<String, ConsumerConfig> getConsumers() { | ||
return consumers; | ||
} | ||
|
||
public void setConsumers(Map<String, ConsumerConfig> consumers) { | ||
this.consumers = consumers; | ||
} | ||
|
||
public Map<String, ConfigCenterBean> getConfigCenters() { | ||
return configCenters; | ||
} | ||
|
||
public void setConfigCenters(Map<String, ConfigCenterBean> configCenters) { | ||
this.configCenters = configCenters; | ||
} | ||
|
||
public Map<String, MetadataReportConfig> getMetadataReports() { | ||
return metadataReports; | ||
} | ||
|
||
public void setMetadataReports(Map<String, MetadataReportConfig> metadataReports) { | ||
this.metadataReports = metadataReports; | ||
} | ||
|
||
static class Config { | ||
|
||
/** | ||
* Indicates multiple properties binding from externalized configuration or not. | ||
*/ | ||
private boolean multiple = DEFAULT_MULTIPLE_CONFIG_PROPERTY_VALUE; | ||
|
||
public boolean isMultiple() { | ||
return multiple; | ||
} | ||
|
||
public void setMultiple(boolean multiple) { | ||
this.multiple = multiple; | ||
} | ||
} | ||
|
||
static class Scan { | ||
|
||
/** | ||
* The basePackages to scan , the multiple-value is delimited by comma | ||
* | ||
* @see EnableDubbo#scanBasePackages() | ||
*/ | ||
private Set<String> basePackages = new LinkedHashSet<>(); | ||
|
||
public Set<String> getBasePackages() { | ||
return basePackages; | ||
} | ||
|
||
public void setBasePackages(Set<String> basePackages) { | ||
this.basePackages = basePackages; | ||
} | ||
} | ||
} |
Oops, something went wrong.