Java Code Examples for org.springframework.beans.factory.support.BeanDefinitionReader

Following code examples demonstrate how to use org.springframework.beans.factory.support.BeanDefinitionReaderfrom spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.beans.factory.support.BeanDefinitionReaderand various code implementation of this class.

    public static void main(String[] args) {
        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();

        BeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory);
        beanDefinitionReader.loadBeanDefinitions("spring-context.xml");
        MessageRenderer renderer = (MessageRenderer) beanFactory.getBean("renderer");
        renderer.printMessage();
    } 


    public static void main(String[] args) {
        ClassPathXmlApplicationContext c;
        BeanDefinition b;
        ApplicationContext ac;
        BeanDefinitionReader a;
        ThreadPoolExecutor tpe;
    } 

    @Override
    protected BeanDefinitionReader createBeanDefinitionReader(
            GenericApplicationContext context) {
        return new GroovyBeanDefinitionReader(context);
    } 

Advertisement
Javadoc
Simple interface for bean definition readers. Specifies load methods with Resource and String locati

on parameters.

Concrete bean definition readers can of course add additional load and register methods for bean definitions, specific to their bean definition format.

Note that a bean definition reader does not have to implement this interface. It only serves as suggestion for bean definition readers that want to follow standard naming conventions. @author Juergen Hoeller @since 1.1 @see org.springframework.core.io.Resource

Read More
Advertisement