private void enhanceExistingSpringWebApplicationContext(ServletContextEvent sce, WebApplicationContext wac) {
LOGGER.info("Enhancing existing Spring application context...");
String cosmoContextLocation = sce.getServletContext().getInitParameter(CONTEXT_PARAM_NAME);
@SuppressWarnings("resource")
GenericXmlApplicationContext cosmoAppCtxt = new GenericXmlApplicationContext();
cosmoAppCtxt.setEnvironment((ConfigurableEnvironment) wac.getEnvironment());
cosmoAppCtxt.load(cosmoContextLocation);
cosmoAppCtxt.refresh();
cosmoAppCtxt.start();
//make beans that are required from web components (as delegating filter proxy) accesible
((AbstractRefreshableWebApplicationContext)wac).getBeanFactory().setParentBeanFactory(cosmoAppCtxt.getBeanFactory());
LOGGER.info("Enhanced existing Spring application context started");
}
SpringContextInitializerListener.java 文件源码
java
阅读 15
收藏 0
点赞 0
评论 0
项目:cosmo
作者:
评论列表
文章目录