setTargetClass(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).
Copy configuration from the other AbstractBeanFactoryBasedTargetSource object.
Subclasses should override this if they wish to expose it.
Parameters: other - object to copy configuration from
Set the owning BeanFactory. We need to save a reference so that we can
use the getBean method on every invocation.
setTargetBeanName
public void setTargetBeanName(String targetBeanName)(Code)
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 .
Parameters: targetBeanName - name of the target bean in the BeanFactorythat owns this interceptor See Also:SingletonTargetSource
setTargetClass
public void setTargetClass(Class targetClass)(Code)
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).
Replaces this object with a SingletonTargetSource on serialization.
Protected as otherwise it won't be invoked for subclasses.
(The writeReplace() method must be visible to the class
being serialized.)
With this implementation of this method, there is no need to mark
non-serializable fields in this class or subclasses as transient.