Package org.springframework.context.support

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


 
  @Override
  public void performAction(CatalogServiceClient csClient) throws Exception {
    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { this.beanRepo }, false);
    appContext.setClassLoader(new Serializer().getClassLoader());
    appContext.refresh();
    CatalogRepositoryFactory factory = (CatalogRepositoryFactory) appContext.getBean(this.beanId, CatalogRepositoryFactory.class);
    CatalogRepository catalogRepository = factory.createRepository();
    Set<Catalog> catalogs = catalogRepository.deserializeAllCatalogs();
    System.out.println("Deserialized Catalogs: " + catalogs.toString());
    for (Catalog catalog : catalogs) {
View Full Code Here


      // so fallback on a file-based class loader
      final FileSystemXmlApplicationContext ac = new FileSystemXmlApplicationContext(new String[] {
        beanDefRef.toString()
      }, false);
      ac.setClassLoader(AbstractEntityGraphPopulator.class.getClassLoader());
      ac.refresh();
      return ac;
    }
  }

  private final ListableBeanFactory beanFactory;
View Full Code Here

              // so fallback on a file-based class loader
              final FileSystemXmlApplicationContext ac = new FileSystemXmlApplicationContext(new String[] {
                beanDefRef.toString()
              }, false);
              ac.setClassLoader(getClass().getClassLoader());
              ac.refresh();
              return ac;
            }
          }
        });
View Full Code Here

    switch (command.getType()) {
      case INIT:
        state = State.STARTING;
        FileSystemXmlApplicationContext ctx = createContext(Environment.ProcessName.get());
        ctx.setConfigLocations(getConfigurationFiles());
        ctx.refresh();
        context = ctx;

        // We delegate the command to all classes that implement the Application interface and
        // are registered Spring beans inside the context.
        listeners = context.getBeansOfType(Application.class);
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

      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

  @Test
  public void testSpring() throws Exception {
    PentahoSystem.clearObjectFactory();
    FileSystemXmlApplicationContext context =
        new FileSystemXmlApplicationContext( "test-res/SystemConfig/system/testPropertyPlaceholders.spring.xml" );
    context.refresh();

    assertNotNull( context.getBean( "testPlaceHolder" ) );
    assertEquals( "A dog's tale", context.getBean( "testPlaceHolder" ) );
  }
View Full Code Here

    props.setProperty( "someProperty", "new value" );
    configuration.update( props );

    FileSystemXmlApplicationContext context =
        new FileSystemXmlApplicationContext( "test-res/SystemConfig/system/testPropertyPlaceholders.spring.xml" );
    context.refresh();

    assertNotNull( context.getBean( "testPlaceHolder" ) );
    assertEquals( "new value", context.getBean( "testPlaceHolder" ) );
    props = configuration.getProperties();
    props.setProperty( "someProperty", "A dog's tale" );
View Full Code Here

    PentahoSystem.setApplicationContext( new StandaloneApplicationContext( "test-res/SystemConfig", "" ) );

    FileSystemXmlApplicationContext context =
        new FileSystemXmlApplicationContext(
            "test-res/SystemConfig/system/testPropertyPlaceholders-system-settings.spring.xml" );
    context.refresh();

    assertNotNull( context.getBean( "testPlaceHolder" ) );
    assertEquals( "Hypersonic", context.getBean( "testPlaceHolder" ) );

    assertNotNull( context.getBean( "testPlaceHolder2" ) );
View Full Code Here

            tempFile.deleteOnExit();
            context.setConfigLocation(tempFile.getAbsolutePath());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        context.refresh();
        context.registerShutdownHook();
        return null;//kieSpringApplicationListener.getKieModuleModel();
    }

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