如下是研读大拿代码截取下来的,方便以后开发中使用
public class SystemProperties extends PropertyPlaceholderConfigurer {
protected Logger log = LoggerFactory.getLogger(this.getClass());
@Override
protected void processProperties( ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException {
Properties result = new Properties();
if (PropertiesConfigContext.IsInited()){
result = PropertiesConfigContext.getSysproperties();
} else {
PropertiesConfigContext.initConfig();
Properties propbackup = new BackUpPropertiesLoader().getProperties();
CollectionUtils.mergePropertiesIntoMap(propbackup, result);
PropertiesConfigContext.SetConfigInitInfo(result);
}
super.processProperties(beanFactoryToProcess, result);
}
}