Package org.springframework.beans.factory.xml

Examples of org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions()


        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this);
        reader.setParserClass(DEFAULT_PARSER_CLASS);
        reader.setEntityResolver(new CeltixBeansDtdResolver());
        reader.setValidating(false);
        reader.setNamespaceAware(true);
        reader.loadBeanDefinitions(res);
             
        editor = new JaxbPropertyEditor();
        registerCustomEditor(String.class, editor);
       
        PropertyEditor pe = null;
View Full Code Here


          String errorMessage = "Cannot look up Spring configuration " + configKey;
          log.error(errorMessage);
          throw new SynapseException(errorMessage);
        }

        xbdr.loadBeanDefinitions(
            new InputStreamResource(
                SynapseConfigUtils.getStreamSource(springConfig).getInputStream()));
        appContext.refresh();
        if (synLog.isTraceOrDebugEnabled()) {
            synLog.traceOrDebug("Spring ApplicationContext from key : " + configKey + " created");
View Full Code Here

    static GenericApplicationContext getContext() {
        log.info("Creating Spring Application Context ...");
        GenericApplicationContext ctx = new GenericApplicationContext();
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(ctx);
        reader.loadBeanDefinitions(new ClassPathResource("/applicationContext.xml"));

        ctx.refresh();
        return ctx;
    }
}
View Full Code Here

        GenericApplicationContext appContext = new GenericApplicationContext(busApplicationContext);
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(appContext);
        List<URL> urls = ClassLoaderUtils.getResources("META-INF/cxf/java2wsbeans.xml",
                                                       SpringServiceBuilderFactory.class);
        for (URL url : urls) {
            reader.loadBeanDefinitions(new UrlResource(url));
        }
       
        for (String pathname : additionalFilePathnames) {
            try {
                reader.loadBeanDefinitions(new FileSystemResource(pathname));
View Full Code Here

            reader.loadBeanDefinitions(new UrlResource(url));
        }
       
        for (String pathname : additionalFilePathnames) {
            try {
                reader.loadBeanDefinitions(new FileSystemResource(pathname));
            } catch (BeanDefinitionStoreException bdse) {
                throw new ToolException("Unable to open bean definition file " + pathname, bdse.getCause());
            }
        }
        appContext.refresh();
View Full Code Here

    // delegate work to Spring framework...
    _factory=new GeronimoBeanFactory();
    XmlBeanDefinitionReader xbdr=new XmlBeanDefinitionReader(_factory);
    xbdr.setBeanClassLoader(_appClassLoader);
    xbdr.loadBeanDefinitions(new ClassPathResource(_configPath.toString(), _appClassLoader));

    // install aspects around Spring Bean initialisation...
    _factory.addBeanPostProcessor(new BeanPostProcessor() {
       public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
         return beforeInitialization(bean, name);
View Full Code Here

            context.setClassLoader(classLoader);
            ResourceLoader resourceLoader = new DefaultResourceLoader(classLoader);
            context.setResourceLoader(resourceLoader);
            BeanDefinitionReader reader = new XmlBeanDefinitionReader(context);
            for (String resource : resources) {
                reader.loadBeanDefinitions(resourceLoader.getResource(resource));
            }
            context.refresh();
            return context;
        }
View Full Code Here

  @Test
  public void registersJackson2InitializerCorrectly() {

    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
    reader.loadBeanDefinitions(getPopulatorResource());

    BeanDefinition definition = beanFactory.getBeanDefinition("jackson2-populator");
    assertThat(definition, is(notNullValue()));

    Object bean = beanFactory.getBean("jackson2-populator");
View Full Code Here

  @Test
  public void registersXmlInitializerCorrectly() {

    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
    reader.loadBeanDefinitions(getPopulatorResource());

    BeanDefinition definition = beanFactory.getBeanDefinition("xml-populator");
    assertThat(definition, is(notNullValue()));

    Object bean = beanFactory.getBean("xml-populator");
View Full Code Here

    public ApplicationContext enrichedContext() throws IOException {
        GenericApplicationContext that=new GenericApplicationContext(applicationContext);
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(that);
        reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
        reader.loadBeanDefinitions(new InputStreamResource(getContextXml()));
        that.refresh();
        return that;
    }

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.