Examples of FactoryBean


Examples of org.springframework.beans.factory.FactoryBean

    sac.refresh();

    TestAutoProxyCreator tapc = (TestAutoProxyCreator) sac.getBean("testAutoProxyCreator");
    tapc.testInterceptor.nrOfInvocations = 0;

    FactoryBean factory = (FactoryBean) sac.getBean("&singletonFactoryToBeProxied");
    assertFalse(AopUtils.isAopProxy(factory));

    TestBean tb = (TestBean) sac.getBean("singletonFactoryToBeProxied");
    assertTrue(AopUtils.isCglibProxy(tb));
    assertEquals(0, tapc.testInterceptor.nrOfInvocations);

Examples of org.springframework.beans.factory.FactoryBean

    sac.refresh();

    TestAutoProxyCreator tapc = (TestAutoProxyCreator) sac.getBean("testAutoProxyCreator");
    tapc.testInterceptor.nrOfInvocations = 0;

    FactoryBean prototypeFactory = (FactoryBean) sac.getBean("&prototypeFactoryToBeProxied");
    assertTrue(AopUtils.isCglibProxy(prototypeFactory));
    TestBean tb = (TestBean) sac.getBean("prototypeFactoryToBeProxied");
    assertFalse(AopUtils.isCglibProxy(tb));

    assertEquals(2, tapc.testInterceptor.nrOfInvocations);
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.