1 public static void main(String[] args)
 2 {
 3   DefaultListableBeanFactory  beanRegistry=new DefaultListableBeanFactory();
 4   BeanFactory container=(BeanFactory)bindViaPropertiesFile(beanRegistry);
 5 
 6   FXNewsProvider newsProvider=(FXNewsProvider)container.getBean("djNewsProvider");  
 7   newsProvider.getAndPersistNews();
 8 }
 9 
10 public static BeanFactory bindViaPropertiesFile(BeanDefinitionRegistry registry)
11 {
12   PropertiesBeanDefinitionReader reader= new PropertiesBeanDefinitionReader(registry);
13   reader.loadBeanDefinitions("classpath:http://www.cnblogs.com/binding-config.properties");
14   
15   return (BeanFactory)registry;
16 }

 

相关文章:

  • 2022-02-22
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2021-07-16
  • 2021-12-04
猜你喜欢
  • 2022-02-05
  • 2022-01-12
  • 2022-12-23
  • 2021-09-19
  • 2022-02-22
  • 2018-03-27
  • 2022-01-28
相关资源
相似解决方案