Package org.springframework.config.java.annotation

Examples of org.springframework.config.java.annotation.ExternalBean


  /**
   * @param targetMethod must be non-private and annotated with
   * {@link ExternalBean}
   */
  public Object processMethod(Method targetMethod) {
    ExternalBean externalBean = AnnotationUtils.findAnnotation(targetMethod, ExternalBean.class);

    Assert.notNull(externalBean, "method must be annotated with @ExternalBean");
    Assert.isTrue(!Modifier.isPrivate(targetMethod.getModifiers()), "@ExternalBean methods may not be private");

    String beanName;

    if (!"".equals(externalBean.value()))
      beanName = externalBean.value();
    else
      beanName = namingStrategy.getBeanName(targetMethod);

    return owningBeanFactory.getBean(beanName);
  }
View Full Code Here

TOP

Related Classes of org.springframework.config.java.annotation.ExternalBean

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.