Package org.springframework.web.context.support

Examples of org.springframework.web.context.support.GenericWebApplicationContext.refresh()


    XmlBeanDefinitionReader definitionReader = new XmlBeanDefinitionReader(beanFactory);
    for (int i = 0; i < locations.length; i++) {
      definitionReader.loadBeanDefinitions(new ClassPathResource(locations[i]));
    }
    applicationContext.refresh();

    return ObjectUtils.cast(applicationContext.getBean("moduleManagementFacade"), ModuleManagementFacade.class);
  }

  public abstract ModuleDefinitionSource getModuleDefinitionSource(ServletContext servletContext, ModuleManagementFacade factory);
View Full Code Here


public class WebPlaceholderDelegatingContextLoader implements DelegatingContextLoader {

  public ConfigurableApplicationContext loadApplicationContext(ApplicationContext parent, ModuleDefinition definition) {
    GenericWebApplicationContext context = new GenericWebApplicationContext();
    context.refresh();
    return context;
  }

}
View Full Code Here

    XmlBeanDefinitionReader definitionReader = new XmlBeanDefinitionReader(beanFactory);
    for (int i = 0; i < locations.length; i++) {
      definitionReader.loadBeanDefinitions(new ClassPathResource(locations[i]));
    }
    applicationContext.refresh();

    return ObjectUtils.cast(applicationContext.getBean("moduleManagementFactory"), ModuleManagementFactory.class);
  }

  @Override
View Full Code Here

    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
    reader.setEnvironment(getApplicationContext().getEnvironment());
    reader.setEntityResolver(new ResourceEntityResolver(getApplicationContext()));
    reader.loadBeanDefinitions(actualLocation);

    factory.refresh();

    if (isCache()) {
      this.cachedFactory = factory;
    }
    return factory;
View Full Code Here

    for (int i = 0; i < bundles.size(); i++) {
      ResourceBundle bundle = (ResourceBundle) bundles.get(i);
      reader.registerBeanDefinitions(bundle);
    }

    factory.refresh();

    // Cache factory for both Locale and ResourceBundle list.
    if (isCache()) {
      this.localeCache.put(locale, factory);
      this.bundleCache.put(bundles, factory);
View Full Code Here

    // Load XML resource with context-aware entity resolver.
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
    reader.setEntityResolver(new ResourceEntityResolver(getApplicationContext()));
    reader.loadBeanDefinitions(actualLocation);

    factory.refresh();

    if (isCache()) {
      this.cachedFactory = factory;
    }
    return factory;
View Full Code Here

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.refresh();
    return context;
  }
 
 
   public static @interface ScopeTestComponent {
View Full Code Here

  public void testStandardHandleMethod() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        GenericWebApplicationContext wac = new GenericWebApplicationContext();
        wac.registerBeanDefinition("controller", new RootBeanDefinition(MyController.class));
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

  public void doTestAdaptedHandleMethods(final Class controllerClass) throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        GenericWebApplicationContext wac = new GenericWebApplicationContext();
        wac.registerBeanDefinition("controller", new RootBeanDefinition(controllerClass));
        wac.refresh();
        return wac;
      }
    };
    portlet.init(new MockPortletConfig());
View Full Code Here

  public void testFormController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        GenericWebApplicationContext wac = new GenericWebApplicationContext();
        wac.registerBeanDefinition("controller", new RootBeanDefinition(MyFormController.class));
        wac.refresh();
        return wac;
      }

      protected void render(ModelAndView mv, RenderRequest request, RenderResponse response) throws Exception {
        new TestView().render(mv.getViewName(), mv.getModel(), request, response);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.