Class AbstractBeanFactoryBasedTargetSourceCreator

  • java.lang.Object
    • Field Detail

      • logger

        protected final Log logger
    • Constructor Detail

      • AbstractBeanFactoryBasedTargetSourceCreator

        public AbstractBeanFactoryBasedTargetSourceCreator()
    • Method Detail

      • getBeanFactory

        protected final BeanFactory getBeanFactory()
        Return the BeanFactory that this TargetSourceCreators runs in.
      • getTargetSource

        public final TargetSource getTargetSource(java.lang.Class<?> beanClass,
                                                            java.lang.String beanName)
        Description copied from interface: TargetSourceCreator
        Create a special TargetSource for the given bean, if any.
        Specified by:
        getTargetSource in interface TargetSourceCreator
        beanClass - the class of the bean to create a TargetSource for
        beanName - the name of the bean
        a special TargetSource or null if this TargetSourceCreator isn't interested in the particular bean
      • getInternalBeanFactoryForBean

        protected DefaultListableBeanFactory getInternalBeanFactoryForBean(java.lang.String beanName)
        Return the internal BeanFactory to be used for the specified bean.
        beanName - the name of the target bean
        the internal BeanFactory to be used
      • buildInternalBeanFactory

        protected DefaultListableBeanFactory buildInternalBeanFactory(ConfigurableBeanFactory containingFactory)
        Build an internal BeanFactory for resolving target beans.
        containingFactory - the containing BeanFactory that originally defines the beans
        an independent internal BeanFactory to hold copies of some target beans
      • isPrototypeBased

        protected boolean isPrototypeBased()
        Return whether this TargetSourceCreator is prototype-based. The scope of the target bean definition will be set accordingly.

        Default is "true".

        See Also:
      • createBeanFactoryBasedTargetSource

        protected abstract AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(java.lang.Class<?> beanClass,
                                                                                                             java.lang.String beanName)
        Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created. Subclasses should not call setTargetBeanName or setBeanFactory on the AbstractPrototypeBasedTargetSource: This class' implementation of getTargetSource() will do that.
        beanClass - the class of the bean to create a TargetSource for
        beanName - the name of the bean
        the AbstractPrototypeBasedTargetSource, or null if we don't match this