Package org.springframework.context.support

Examples of org.springframework.context.support.FileSystemXmlApplicationContext.refresh()


    root.setClassLoader(Thread.currentThread().getContextClassLoader());
    root.setId("red5.root");
    root.setBeanName("red5.root");
    // refresh must be called before accessing the bean factory
    log.trace("Refreshing root server context");
    root.refresh();
    log.trace("Root server context refreshed");
    /*
    if (log.isTraceEnabled()) {
      String[] names = ctx.getBeanDefinitionNames();
      for (String name : names) {
View Full Code Here


    // strange - FSXAC strips leading '/' unless prefixed with 'file:'
    ConfigurableApplicationContext ctx =
        new FileSystemXmlApplicationContext(new String[] {"file:" + tmpFile.getPath()}, false);
    ctx.setEnvironment(prodEnv);
    ctx.refresh();
    assertEnvironmentBeanRegistered(ctx);
    assertHasEnvironment(ctx, prodEnv);
    assertEnvironmentAwareInvoked(ctx, ctx.getEnvironment());
    assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
    assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
View Full Code Here

        if (url != null) {
            FileSystemXmlApplicationContext context = contextMap.get(url);
            if (context != null) {
                try {
                    LOG.info("Refreshing context at path " + path + " context " + context);
                    context.refresh();
                } catch (Exception e) {
                    LOG.warn("Failed to refresh context at " + path + " context " + context + ". " + e, e);
                }
            } else {
                context = createContext(path, url);
View Full Code Here

      String partTwo = URLEncoder.encode(absolutePath.substring(absolutePath.lastIndexOf(File.separator ) + 1), "UTF-8");
      absolutePath = partOne + File.separator + partTwo;
     
      File springFile = new File(new File(absolutePath), SPRING_CONFIG);
      appCtx.setConfigLocation("file:" + springFile.getAbsolutePath());
      appCtx.refresh();
     
      return (Collection<FacetHandler<?>>) appCtx.getBean("handlers");

  }
 
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.