Examples of MethodInvokingFactoryBean


Examples of org.springframework.beans.factory.config.MethodInvokingFactoryBean

  public void testAspectsAreApplied() {
    ClassPathXmlApplicationContext bf = new ClassPathXmlApplicationContext(
        "/org/springframework/aop/aspectj/autoproxy/aspects.xml");
    ITestBean tb = (ITestBean) bf.getBean("adrian");
    assertEquals(68, tb.getAge());
    MethodInvokingFactoryBean factoryBean = (MethodInvokingFactoryBean) bf.getBean("&factoryBean");
    assertTrue(AopUtils.isAopProxy(factoryBean.getTargetObject()));
    assertEquals(68, ((ITestBean) factoryBean.getTargetObject()).getAge());
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.MethodInvokingFactoryBean

       
        String staticMethod = hLoggerFactories.get(loggerType);

        if (staticMethod != null) {
            try {
                MethodInvokingFactoryBean factory = new MethodInvokingFactoryBean();
                factory.setStaticMethod(staticMethod);
                factory.setArguments(new Object[] { loggerName });
                factory.afterPropertiesSet();
               
                result = factory.getObject();
            } catch (Throwable e) {
                throw new FatalBeanException("Problem injecting logger.  " + e.getMessage(), e);
            }
        }
       
View Full Code Here

Examples of org.springframework.beans.factory.config.MethodInvokingFactoryBean

  @Test
  public void testAspectsAreApplied() {
    ClassPathXmlApplicationContext bf = newContext("aspects.xml");
    ITestBean tb = (ITestBean) bf.getBean("adrian");
    assertEquals(68, tb.getAge());
    MethodInvokingFactoryBean factoryBean = (MethodInvokingFactoryBean) bf.getBean("&factoryBean");
    assertTrue(AopUtils.isAopProxy(factoryBean.getTargetObject()));
    assertEquals(68, ((ITestBean) factoryBean.getTargetObject()).getAge());
  }
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.