org.springframework.aop.TargetSource implementations
that are based on a Spring org.springframework.beans.factory.BeanFactory ,
delegating to Spring-managed bean instances.
Subclasses can create prototype instances or lazily access a
singleton target, for example. See LazyInitTargetSource and
AbstractPrototypeBasedTargetSource's subclasses for concrete strategies.
BeanFactory-based TargetSources are serializable. This involves
disconnecting the current target and turning into a SingletonTargetSource.
org.springframework.beans.factory.BeanFactory#getBean , LazyInitTargetSource, PrototypeTargetSource, ThreadLocalTargetSource, CommonsPool2TargetSource
| Modifier and Type | Field and Description |
|---|---|
| private BeanFactory | beanFactory
BeanFactory that owns this TargetSource. |
| protected final transient Log | logger
Logger available to subclasses. |
| private static final long | serialVersionUID
use serialVersionUID from Spring 1.2.7 for interoperability. |
| private String | targetBeanName
Name of the target bean we will create on each invocation. |
| private volatile Class | targetClass
Class of the target. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | copyFrom(AbstractBeanFactoryBasedTargetSource
object to copy configuration from other)Copy configuration from the other AbstractBeanFactoryBasedTargetSource object. |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public BeanFactory | |
| public String | |
| public Class | getTargetClass()
Implements org. Return the type of targets returned by this |
| public int | |
| public void | setBeanFactory(BeanFactory
owning BeanFactory (never beanFactory)null).
The bean can immediately call methods on the factory.Implements org. Set the owning BeanFactory. |
| public void | setTargetBeanName(String
name of the target bean in the BeanFactory
that owns this interceptor targetBeanName)Set the name of the target bean in the factory. |
| public void | 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). |
| public String |
| beanFactory | back to summary |
|---|---|
| private BeanFactory beanFactory BeanFactory that owns this TargetSource. We need to hold onto this reference so that we can create new prototype instances as necessary. | |
| logger | back to summary |
|---|---|
| protected final transient Log logger Logger available to subclasses. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID use serialVersionUID from Spring 1.2.7 for interoperability. | |
| targetBeanName | back to summary |
|---|---|
| private String targetBeanName Name of the target bean we will create on each invocation. | |
| targetClass | back to summary |
|---|---|
| private volatile Class<?> targetClass Class of the target. | |
| AbstractBeanFactoryBasedTargetSource | back to summary |
|---|---|
| public AbstractBeanFactoryBasedTargetSource() | |
| copyFrom | back to summary |
|---|---|
| protected void copyFrom(AbstractBeanFactoryBasedTargetSource other) Copy configuration from the other AbstractBeanFactoryBasedTargetSource object. Subclasses should override this if they wish to expose it.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getBeanFactory | back to summary |
|---|---|
| public BeanFactory getBeanFactory() Return the owning BeanFactory. | |
| getTargetBeanName | back to summary |
|---|---|
| public String getTargetBeanName() Return the name of the target bean in the factory. | |
| getTargetClass | back to summary |
|---|---|
| public Class Implements org. Doc from org. Return the type of targets returned by this Can return
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| setBeanFactory | back to summary |
|---|---|
| public void setBeanFactory(BeanFactory beanFactory) Implements org. Set the owning BeanFactory. We need to save a reference so that we can
use the
| |
| setTargetBeanName | back to summary |
|---|---|
| public void setTargetBeanName(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
| |
| setTargetClass | back to summary |
|---|---|
| public void 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). Default is to detect the type automatically, through a | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |