Package org.springframework.beans.factory.support

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


   */
  @Test
  public void postProcessorIntrospectsInheritedDefinitionsCorrectly() {
    beanFactory.registerBeanDefinition("config", new RootBeanDefinition(SingletonBeanConfig.class));
    beanFactory.registerBeanDefinition("parent", new RootBeanDefinition(TestBean.class));
    beanFactory.registerBeanDefinition("child", new ChildBeanDefinition("parent"));
    ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
    pp.postProcessBeanFactory(beanFactory);
    Foo foo = beanFactory.getBean("foo", Foo.class);
    Bar bar = beanFactory.getBean("bar", Bar.class);
    assertSame(foo, bar.foo);
View Full Code Here


    innerPvs.add("touchy", "${os.name}");
    RootBeanDefinition innerBd = new RootBeanDefinition(TestBean.class);
    innerBd.setPropertyValues(innerPvs);
    someMap.put("key3", innerBd);
    MutablePropertyValues innerPvs2 = new MutablePropertyValues(innerPvs);
    someMap.put("${key4}", new BeanDefinitionHolder(new ChildBeanDefinition("tb1", innerPvs2), "child"));
    pvs.add("someMap", someMap);

    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, cas, pvs);
    wac.getDefaultListableBeanFactory().registerBeanDefinition("tb2", bd);
View Full Code Here

    GenericApplicationContext context = new GenericApplicationContext();
    ConstructorArgumentValues args = new ConstructorArgumentValues();
    args.addGenericArgumentValue("bar");
    context.registerBeanDefinition("parent", new RootBeanDefinition(
        JobSupport.class, args, null));
    context.registerBeanDefinition("bean", new ChildBeanDefinition("parent"));
    context.refresh();
    JobSupport configuration = (JobSupport) context
        .getBean("bean");
    assertNotNull(configuration.getName());
    assertEquals("bar", configuration.getName());
View Full Code Here

  }

  private static BeanDefinition getBeanDefinition(IDOMNode node) {
    AbstractBeanDefinition bd = null;
    if (BeansEditorUtils.getAttribute(node, "parent") != null) {
      bd = new ChildBeanDefinition(BeansEditorUtils.getAttribute(node, "parent"));
      bd.setBeanClassName(getClassName(node));
    }
    else {
      bd = new RootBeanDefinition(getClassName(node));
    }
View Full Code Here

            }
            if(StringUtils.isBlank(parentName)) {
                bd = new RootBeanDefinition(clazz,cav,null);
            }
            else {
                bd = new ChildBeanDefinition(parentName,clazz,cav, null);
            }
            bd.setSingleton(singleton);
    }
    else {
            if(StringUtils.isBlank(parentName)) {
                bd = new RootBeanDefinition(clazz,singleton);
            }
            else {
                bd = new ChildBeanDefinition(parentName,clazz, null,null);
                bd.setSingleton(singleton);
            }

    }
    wrapper = new BeanWrapperImpl(bd);
View Full Code Here

TOP

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

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.