Package org.springframework.beans

Examples of org.springframework.beans.NestedTestBean


    bf.registerBeanDefinition("annotatedBean", rbd);
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    IndexedTestBean itb = new IndexedTestBean();
    bf.registerSingleton("indexedTestBean", itb);
    NestedTestBean ntb1 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean1", ntb1);

    // Two calls to verify that caching doesn't break re-creation.
    OptionalCollectionResourceInjectionBean bean = (OptionalCollectionResourceInjectionBean) bf.getBean("annotatedBean");
    bean = (OptionalCollectionResourceInjectionBean) bf.getBean("annotatedBean");
View Full Code Here


    RootBeanDefinition bd = new RootBeanDefinition(ConstructorResourceInjectionBean.class);
    bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
    bf.registerBeanDefinition("annotatedBean", bd);
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    NestedTestBean ntb = new NestedTestBean();
    bf.registerSingleton("nestedTestBean", ntb);

    ConstructorResourceInjectionBean bean = (ConstructorResourceInjectionBean) bf.getBean("annotatedBean");
    assertSame(tb, bean.getTestBean());
    assertSame(tb, bean.getTestBean2());
View Full Code Here

    bpp.setBeanFactory(bf);
    bf.addBeanPostProcessor(bpp);
    bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(ConstructorsResourceInjectionBean.class));
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    NestedTestBean ntb1 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean1", ntb1);
    NestedTestBean ntb2 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean2", ntb2);

    ConstructorsResourceInjectionBean bean = (ConstructorsResourceInjectionBean) bf.getBean("annotatedBean");
    assertNull(bean.getTestBean3());
    assertSame(tb, bean.getTestBean4());
View Full Code Here

    bf.addBeanPostProcessor(bpp);
    bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(
        ConstructorsCollectionResourceInjectionBean.class));
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    NestedTestBean ntb1 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean1", ntb1);
    NestedTestBean ntb2 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean2", ntb2);

    ConstructorsCollectionResourceInjectionBean bean = (ConstructorsCollectionResourceInjectionBean) bf.getBean("annotatedBean");
    assertNull(bean.getTestBean3());
    assertSame(tb, bean.getTestBean4());
View Full Code Here

    RootBeanDefinition bd = new RootBeanDefinition(TypedExtendedResourceInjectionBean.class);
    bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
    bf.registerBeanDefinition("annotatedBean", bd);
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    NestedTestBean ntb = new NestedTestBean();
    bf.registerSingleton("nestedTestBean", ntb);

    TypedExtendedResourceInjectionBean bean = (TypedExtendedResourceInjectionBean) bf.getBean("annotatedBean");
    assertSame(tb, bean.getTestBean());
    assertSame(tb, bean.getTestBean2());
View Full Code Here

    TestBean tb2 = new TestBean();
    annotatedBd.getPropertyValues().addPropertyValue("testBean2", tb2);
    bf.registerBeanDefinition("annotatedBean", annotatedBd);
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    NestedTestBean ntb = new NestedTestBean();
    bf.registerSingleton("nestedTestBean", ntb);

    TypedExtendedResourceInjectionBean bean = (TypedExtendedResourceInjectionBean) bf.getBean("annotatedBean");
    assertSame(tb, bean.getTestBean());
    assertSame(tb2, bean.getTestBean2());
View Full Code Here

    RootBeanDefinition bd = new RootBeanDefinition(TypedExtendedResourceInjectionBean.class);
    bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
    bf.registerBeanDefinition("annotatedBean", bd);
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    NestedTestBean ntb = new NestedTestBean();
    bf.registerSingleton("nestedTestBean", ntb);

    TypedExtendedResourceInjectionBean bean = (TypedExtendedResourceInjectionBean) bf.getBean("annotatedBean");
    assertSame(tb, bean.getTestBean());
    assertSame(tb, bean.getTestBean2());
View Full Code Here

    bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(OptionalResourceInjectionBean.class));
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    IndexedTestBean itb = new IndexedTestBean();
    bf.registerSingleton("indexedTestBean", itb);
    NestedTestBean ntb1 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean1", ntb1);
    NestedTestBean ntb2 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean2", ntb2);

    OptionalResourceInjectionBean bean = (OptionalResourceInjectionBean) bf.getBean("annotatedBean");
    assertSame(tb, bean.getTestBean());
    assertSame(tb, bean.getTestBean2());
View Full Code Here

    bf.registerBeanDefinition("annotatedBean", rbd);
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    IndexedTestBean itb = new IndexedTestBean();
    bf.registerSingleton("indexedTestBean", itb);
    NestedTestBean ntb1 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean1", ntb1);
    NestedTestBean ntb2 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean2", ntb2);

    // Two calls to verify that caching doesn't break re-creation.
    OptionalCollectionResourceInjectionBean bean = (OptionalCollectionResourceInjectionBean) bf.getBean("annotatedBean");
    bean = (OptionalCollectionResourceInjectionBean) bf.getBean("annotatedBean");
View Full Code Here

    bf.registerBeanDefinition("annotatedBean", rbd);
    TestBean tb = new TestBean();
    bf.registerSingleton("testBean", tb);
    IndexedTestBean itb = new IndexedTestBean();
    bf.registerSingleton("indexedTestBean", itb);
    NestedTestBean ntb1 = new NestedTestBean();
    bf.registerSingleton("nestedTestBean1", ntb1);

    // Two calls to verify that caching doesn't break re-creation.
    OptionalCollectionResourceInjectionBean bean = (OptionalCollectionResourceInjectionBean) bf.getBean("annotatedBean");
    bean = (OptionalCollectionResourceInjectionBean) bf.getBean("annotatedBean");
View Full Code Here

TOP

Related Classes of org.springframework.beans.NestedTestBean

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.