1 16 17 package org.springframework.aop.target.dynamic; 18 19 import org.springframework.beans.factory.BeanFactory; 20 import org.springframework.util.Assert; 21 22 37 public class BeanFactoryRefreshableTargetSource extends AbstractRefreshableTargetSource { 38 39 private final BeanFactory beanFactory; 40 41 private final String beanName; 42 43 44 52 public BeanFactoryRefreshableTargetSource(BeanFactory beanFactory, String beanName) { 53 Assert.notNull(beanFactory, "BeanFactory is required"); 54 Assert.notNull(beanName, "Bean name is required"); 55 this.beanFactory = beanFactory; 56 this.beanName = beanName; 57 } 58 59 60 64 protected Object freshTarget() { 65 return this.beanFactory.getBean(this.beanName); 66 } 67 68 } 69 | Popular Tags |