Package org.springframework.beans.factory.support

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory


   * Test that autowiring can be done on a DefaultListableBeanFactory.
   * @throws Exception
   */
  public void testAutowireDefaultListableBeanFactory() throws Exception {
    BeanFactory parent = BeanFactoryLoader.getBeanFactory("test.bootstrap");
    DefaultListableBeanFactory context = new DefaultListableBeanFactory();
    context.setParentBeanFactory(parent);
    context.registerSingleton("this", this);
    SpringDependencyInjectorTaskTest test = (SpringDependencyInjectorTaskTest) context.getBean("this");
    context.autowireBeanProperties(test, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, false);
    assertNotNull("Null test bean", test);
    assertNotNull("Null properties", test.properties);
  }
View Full Code Here


    int autowireValue = AutowireCapableBeanFactory.AUTOWIRE_BY_NAME;
    if (AUTOWIRE_BY_TYPE.equals(autowire)) {
      autowireValue = AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE;
    }

    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    beanFactory.setParentBeanFactory(parentBeanFactory);
    beanFactory.registerSingleton(taskref, target);

    log("Autowiring reference: " + taskref);

    beanFactory.autowireBeanProperties(target, autowireValue, false);
  }
View Full Code Here

  DefaultListableBeanFactory factory;
  BeanDefinitionReader reader;

  @Before
  public void setUp() {
    factory = new DefaultListableBeanFactory();
    reader = new XmlBeanDefinitionReader(factory);
  }
View Full Code Here

    parserControl = MockClassControl.createControl(targetClass, null, null,
        methodsToMock);
    parser = (AbstractCacheManagerAndProviderFacadeParser) parserControl
        .getMock();
    registry = new DefaultListableBeanFactory();

    cacheProviderFacade = new RootBeanDefinition(CacheProviderFacade.class);
    cacheProviderFacade.setPropertyValues(new MutablePropertyValues());
    registry.registerBeanDefinition(BeanName.CACHE_PROVIDER_FACADE,
        cacheProviderFacade);
View Full Code Here

  BeanFactory bf;

  protected void setUp() throws Exception {
    proxy = new JbpmHandlerProxy();
    locator = new JbpmFactoryLocator();
    bf = new DefaultListableBeanFactory();
    try {
      locator.setBeanFactory(bf);
    } catch (Exception e) {
      // When we inherit the static fields from an old test, clear them out. Stupid statics - they are harmful!
      locator.beanFactories.clear();
View Full Code Here

    sCtrl.verify();
    queryCtrl.verify();
  }

  public void testBeanFactoryRelease() throws Exception {
    BeanFactory beanFactory = new DefaultListableBeanFactory();
   
    configuration.setConfiguration(configurationResource);
    configuration.setBeanFactory(beanFactory);
    configuration.afterPropertiesSet();
   
View Full Code Here

  public static ParserContext create() {
    return create(null);
  }

  public static ParserContext create(BeanDefinitionParserDelegate delegate) {
    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
    XmlReaderContext readerContext = new XmlReaderContext(null, null, null, null, reader,
        null);
    return new ParserContext(readerContext, delegate);
  }
View Full Code Here

    private DefaultListableBeanFactory beanFactory;
   
    public SCADomainContext(String... compositeFiles) {

        // Create Spring bean factory
        beanFactory = new DefaultListableBeanFactory();

        // Create SCA assembly and SCA Java factories
        ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint();
        AssemblyFactory assemblyFactory = new BeanAssemblyFactory(new DefaultAssemblyFactory(), beanFactory);
        modelFactories.addFactory(assemblyFactory);
View Full Code Here

    private DefaultListableBeanFactory beanFactory;
   
    public SCADomainContext(String... compositeFiles) {

        // Create Spring bean factory
        beanFactory = new DefaultListableBeanFactory();

        // Create SCA assembly and SCA Java factories
        ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint();
        AssemblyFactory assemblyFactory = new BeanAssemblyFactory(new DefaultAssemblyFactory(), beanFactory);
        modelFactories.addFactory(assemblyFactory);
View Full Code Here

        refresh();
    }

    @Override
    protected DefaultListableBeanFactory createBeanFactory() {
        return new DefaultListableBeanFactory(getInternalParentBeanFactory()) {
            @Override
            protected boolean allowAliasOverriding() {
                return true;
            }
        };
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.support.DefaultListableBeanFactory

Copyright © 2018 www.massapicom. 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.