customizeContext(context, webMergedConfig); context.refresh(); context.registerShutdownHook(); return context;
public class XmlWebApplicationContextLoader extends AbstractContextLoader { public final ConfigurableApplicationContext loadContext(final String... locations) throws Exception { ServletContext servletContext = new MockServletContext("war", new FileSystemResourceLoader()); GenericWebApplicationContext webContext = new GenericWebApplicationContext(); servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, webContext); webContext.setServletContext(servletContext); new XmlBeanDefinitionReader(webContext).loadBeanDefinitions(locations); AnnotationConfigUtils.registerAnnotationConfigProcessors(webContext); webContext.refresh(); webContext.registerShutdownHook(); return webContext; } protected String getResourceSuffix() { return ""; }
@Override public ApplicationContext loadContext(final String... locations) throws Exception { this.locations = locations; this.servletContext = new MockServletContext(this.contextPath, new FileSystemResourceLoader()); this.webContext = new GenericWebApplicationContext(); this.servletContext.setAttribute(ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.webContext); this.webContext.setServletContext(this.servletContext); new XmlBeanDefinitionReader(this.webContext).loadBeanDefinitions(locations); AnnotationConfigUtils.registerAnnotationConfigProcessors(this.webContext); this.webContext.refresh(); this.webContext.registerShutdownHook(); return this.webContext; }
customizeContext(context, webMergedConfig); context.refresh(); context.registerShutdownHook(); return context;
customizeContext(context, webMergedConfig); context.refresh(); context.registerShutdownHook(); return context;
protected GenericWebApplicationContext loadContext (GenericWebApplicationContext context, String ... locations) { prepareContext(context); customizeBeanFactory(context.getDefaultListableBeanFactory()); loadBeanDefinitions(context, locations); AnnotationConfigUtils.registerAnnotationConfigProcessors(context); customizeContext(context); context.refresh(); context.registerShutdownHook(); return context; }