메인 메소드에서 호출했을때 refresh 메소스에서 처리하게 된다.
public static void main(String[] args) {
String[] configLocations = new String[] { "applicationContext.xml",
"commonConcern.xml" };
ApplicationContext context = new ClassPathXmlApplicationContext(
configLocations);
WriteArticleService articleService = (WriteArticleService) context
.getBean("writeArticleService");
articleService.write(new Article());
}
public void refresh()
throws BeansException, IllegalStateException
{
synchronized(startupShutdownMonitor)
{
prepareRefresh();
ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();
prepareBeanFactory(beanFactory);
try
{
postProcessBeanFactory(beanFactory);
invokeBeanFactoryPostProcessors(beanFactory);
registerBeanPostProcessors(beanFactory);
initMessageSource();
initApplicationEventMulticaster();
initLifecycleDependentBeans();
onRefresh();
registerListeners();
finishBeanFactoryInitialization(beanFactory);
finishRefresh();
}
catch(BeansException ex)
{
beanFactory.destroySingletons();
cancelRefresh(ex);
throw ex;
}
}
}
public static void main(String[] args) {
String[] configLocations = new String[] { "applicationContext.xml",
"commonConcern.xml" };
ApplicationContext context = new ClassPathXmlApplicationContext(
configLocations);
WriteArticleService articleService = (WriteArticleService) context
.getBean("writeArticleService");
articleService.write(new Article());
}
public void refresh()
throws BeansException, IllegalStateException
{
synchronized(startupShutdownMonitor)
{
prepareRefresh();
ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();
prepareBeanFactory(beanFactory);
try
{
postProcessBeanFactory(beanFactory);
invokeBeanFactoryPostProcessors(beanFactory);
registerBeanPostProcessors(beanFactory);
initMessageSource();
initApplicationEventMulticaster();
initLifecycleDependentBeans();
onRefresh();
registerListeners();
finishBeanFactoryInitialization(beanFactory);
finishRefresh();
}
catch(BeansException ex)
{
beanFactory.destroySingletons();
cancelRefresh(ex);
throw ex;
}
}
}
'IT-Consultant' 카테고리의 다른 글
스프링 2.5 소스를 톰캣에 올리려고 하니 약간의 문제가 발생하였다. (0) | 2009.02.02 |
---|---|
공유기 LG-5000P (1) | 2009.01.31 |
eclipse + jad + jadClipse 설정 (0) | 2009.01.30 |
Vista Telnet 사용하기(펌) (0) | 2009.01.29 |
시간날때 이걸 좀 봐야겠다. (0) | 2009.01.29 |