org.springframework.aop.target.dynamic

Class BeanFactoryRefreshableTargetSource

    • Constructor Detail

      • BeanFactoryRefreshableTargetSource

        public BeanFactoryRefreshableTargetSource(BeanFactory beanFactory,
                                                  java.lang.String beanName)
        Create a new BeanFactoryRefreshableTargetSource for the given bean factory and bean name.

        Note that the passed-in BeanFactory should have an appropriate bean definition set up for the given bean name.

        Parameters:
        beanFactory - the BeanFactory to fetch beans from
        beanName - the name of the target bean
    • Method Detail

      • obtainFreshBean

        protected java.lang.Object obtainFreshBean(BeanFactory beanFactory,
                                                   java.lang.String beanName)
        A template method that subclasses may override to provide a fresh target object for the given bean factory and bean name.

        This default implementation fetches a new target bean instance from the bean factory.

        See Also:
        BeanFactory.getBean(java.lang.String)