Class AbstractBeanFactoryBasedTargetSource

  • java.lang.Object
    • Field Detail

      • logger

        protected final Log logger
        Logger available to subclasses.
    • Constructor Detail

      • AbstractBeanFactoryBasedTargetSource

        public AbstractBeanFactoryBasedTargetSource()
    • Method Detail

      • setTargetBeanName

        public void setTargetBeanName(java.lang.String targetBeanName)
        Set the name of the target bean in the factory.

        The target bean should not be a singleton, else the same instance will always be obtained from the factory, resulting in the same behavior as provided by SingletonTargetSource.

        targetBeanName - name of the target bean in the BeanFactory that owns this interceptor
        See Also:
      • getTargetBeanName

        public java.lang.String getTargetBeanName()
        Return the name of the target bean in the factory.
      • setTargetClass

        public void setTargetClass(java.lang.Class<?> targetClass)
        Specify the target class explicitly, to avoid any kind of access to the target bean (for example, to avoid initialization of a FactoryBean instance).

        Default is to detect the type automatically, through a getType call on the BeanFactory (or even a full getBean call as fallback).

      • setBeanFactory

        public void setBeanFactory(BeanFactory beanFactory)
        Set the owning BeanFactory. We need to save a reference so that we can use the getBean method on every invocation.
        Specified by:
        setBeanFactory in interface BeanFactoryAware
        beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
        See Also:
      • getBeanFactory

        public BeanFactory getBeanFactory()
        Return the owning BeanFactory.
      • releaseTarget

        public void releaseTarget(java.lang.Object target)
                           throws java.lang.Exception
        Description copied from interface: TargetSource
        Release the given target object obtained from the TargetSource.getTarget() method, if any.
        Specified by:
        releaseTarget in interface TargetSource
        target - object obtained from a call to TargetSource.getTarget()
        java.lang.Exception - if the object can't be released
      • copyFrom

        protected void copyFrom(AbstractBeanFactoryBasedTargetSource other)
        Copy configuration from the other AbstractBeanFactoryBasedTargetSource object. Subclasses should override this if they wish to expose it.
        other - object to copy configuration from
      • equals

        public boolean equals(java.lang.Object other)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object