Package org.springframework.beans.factory.support

Examples of org.springframework.beans.factory.support.BeanDefinitionReader.loadBeanDefinitions()


            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


  private DefaultListableBeanFactory beanFactory;

  protected void setUp() throws Exception {
    this.beanFactory = new DefaultListableBeanFactory();
    BeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
    reader.loadBeanDefinitions(new ClassPathResource("collectionMerging.xml", getClass()));
  }

  public void testMergeList() throws Exception {
    TestBean bean = (TestBean) this.beanFactory.getBean("childWithList");
    List list = bean.getSomeList();
View Full Code Here

      }
    }

    BeanDefinitionReader beanDefinitionReader = moduleLoader.newBeanDefinitionReader(applicationId,
        parentContext, newRootDefinition);
    beanDefinitionReader.loadBeanDefinitions(toAddList.toArray(new Resource[toAddList.size()]));
  }

  private List<Resource> newResourceList(Resource[] array) {
    List<Resource> list = new ArrayList<Resource>();
    for (Resource resource : array) {
View Full Code Here

                if (reader instanceof AbstractBeanDefinitionReader) {
                    ((AbstractBeanDefinitionReader) reader).setBeanClassLoader(classLoader);
                }
   
                final Resource[] resources = moduleLoader.getSpringConfigResources(applicationId, definition, classLoader);
                reader.loadBeanDefinitions(resources);
            }

            moduleLoader.handleRefresh(applicationId, context, definition);
            return context;
        }
View Full Code Here

        if (reader instanceof AbstractBeanDefinitionReader) {
          ((AbstractBeanDefinitionReader) reader).setBeanClassLoader(classLoader);
        }
 
        final Resource[] resources = moduleLoader.getSpringConfigResources(definition, classLoader);
        reader.loadBeanDefinitions(resources);
      }

      moduleLoader.handleRefresh(context);
      return context;
    }
View Full Code Here

      }
    }

    BeanDefinitionReader beanDefinitionReader = moduleLoader.newBeanDefinitionReader(parentContext,
        newRootDefinition);
    beanDefinitionReader.loadBeanDefinitions(toAddList.toArray(new Resource[toAddList.size()]));

    return true;
  }

  private List<Resource> newResourceList(Resource[] array) {
View Full Code Here

                if (reader instanceof AbstractBeanDefinitionReader) {
                    ((AbstractBeanDefinitionReader) reader).setBeanClassLoader(classLoader);
                }
   
                final Resource[] resources = moduleLoader.getSpringConfigResources(applicationId, definition, classLoader);
                reader.loadBeanDefinitions(resources);
            }

            moduleLoader.handleRefresh(applicationId, context, definition);
            return context;
        }
View Full Code Here

                if (reader instanceof AbstractBeanDefinitionReader) {
                    ((AbstractBeanDefinitionReader) reader).setBeanClassLoader(classLoader);
                }
   
                final Resource[] resources = moduleLoader.getSpringConfigResources(definition, classLoader);
                reader.loadBeanDefinitions(resources);
            }

            moduleLoader.handleRefresh(context);
            return context;
        }
View Full Code Here

      BeanDefinitionReader reader = moduleLoader.newBeanDefinitionReader(context, definition);

      if (reader instanceof AbstractBeanDefinitionReader) {
        ((AbstractBeanDefinitionReader) reader).setBeanClassLoader(classLoader);
      }
      reader.loadBeanDefinitions(resources);

      // refresh the application context - now we're ready to go
      context.refresh();
      return context;
    }
View Full Code Here

        if (reader instanceof AbstractBeanDefinitionReader) {
          ((AbstractBeanDefinitionReader) reader).setBeanClassLoader(classLoader);
        }
 
        final Resource[] resources = moduleLoader.getSpringConfigResources(definition, classLoader);
        reader.loadBeanDefinitions(resources);
      }

      moduleLoader.handleRefresh(context);
      return context;
    }
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.