??????????
????disconf-web????????????web????????????? https://github.com/knightliao/disconf/tree/master/disconf-web
?????????????????disconf-client?????????
????????disconf???
???????????漰?? ???ò????????顢?????顢??????顢watch??飬
????http://ww1.sinaimg.cn/bmiddle/60c9620fjw1eqj9zzgc7yj20b20pn41v.jpg
???????AOP?????????????????????????????????????粢???????μ?????????Ч???????????????????????
???????????????????????????????????????????????????????????????????@Autowired???????е???????????????????????JavaBean???????????????????????????????????????????????????
@Service
@DisconfFile(filename = "redis.properties")
public class JedisConfig {
// ??????????
private String host;
// ????????port
private int port;
/**
* ????? ???????????
*
* @return
*/
@DisconfFileItem(name = "redis.host"?? associateField = "host")
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
/**
* ???? ???????????
*
* @return
*/
@DisconfFileItem(name = "redis.port"?? associateField = "port")
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
}
????????XML????disconf???
????????????????κδ????????????????á?
????ReloadablePropertiesFactoryBean?????Spring Properties?????PropertiesFactoryBean?????????е??????????????reload????????????????????????????????????????? ???ò????????顢?????顢??????顢watch??? ???????????????ò????
????ReloadingPropertyPlaceholderConfigurer?????Spring Bean???????????PropertyPlaceholderConfigurer???????????spring bean??disconf?????????????????????Щbean?й?????
????ReloadConfigurationMonitor???????????????check???????????????и????
??????????????????????????????????????????????????ReloadConfigurationMonitor???????????????????? ReloadingPropertyPlaceholderConfigurer ??????bean???????????
??????????????????????????????????????Ч??????
???????????????
??????????У?????????????????????????????????????????????????????????????????????????????????zookeeper???????????????
????Comparisons