提交 e3e6df8f 编写于 作者: W william.liangf

DUBBO-161 用dubbo.properties作为最后一级缺省值

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@849 1a56cb94-b969-4eaa-88fa-be21384802f2
上级 e3979735
......@@ -66,9 +66,9 @@ public abstract class AbstractConfig implements Serializable {
for (Method method : methods) {
try {
String name = method.getName();
if (name.startsWith("set") && Modifier.isPublic(method.getModifiers())
if (name.length() > 3 && name.startsWith("set") && Modifier.isPublic(method.getModifiers())
&& method.getParameterTypes().length == 1 && isPrimitive(method.getParameterTypes()[0])) {
String key = name.substring(3);
String key = name.substring(3, 4).toLowerCase() + name.substring(4);
if (prefix != null && prefix.length() > 0) {
key = prefix + "." + key;
}
......
......@@ -127,7 +127,6 @@ public abstract class AbstractReferenceConfig extends AbstractMethodConfig {
String applicationName = ConfigUtils.getProperty("dubbo.application.name");
if (applicationName != null && applicationName.length() > 0) {
application = new ApplicationConfig();
application.setName(applicationName);
appendProperties(application, ConfigUtils.getProperties(), "dubbo.application");
}
}
......@@ -182,7 +181,15 @@ public abstract class AbstractReferenceConfig extends AbstractMethodConfig {
protected URL loadMonitor(URL registryURL) {
if (monitor == null) {
return null;
String monitorAddress = ConfigUtils.getProperty("dubbo.monitor.address");
String monitorProtocol = ConfigUtils.getProperty("dubbo.monitor.protocol");
if (monitorAddress != null && monitorAddress.length() > 0
|| monitorProtocol != null && monitorProtocol.length() > 0) {
monitor = new MonitorConfig();
appendProperties(monitor, ConfigUtils.getProperties(), "dubbo.monitor");
} else {
return null;
}
}
Map<String, String> map = new HashMap<String, String>();
map.put(Constants.INTERFACE_KEY, MonitorService.class.getName());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册