类 AbstractBeanFactoryTargetSource
- 所有已实现的接口:
TargetClassAware,TargetSource,Aware,BeanFactoryAware,Serializable
TargetSource implementations that are
based on a BeanFactory, delegating to
ioc-managed bean instances.
Subclasses can create prototype instances or lazily access a singleton
target, for example. See AbstractPrototypeTargetSource's subclasses
for concrete strategies.
BeanFactory-based TargetSources are serializable. This involves disconnecting
the current target and turning into a SingletonTargetSource.
- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller, Rod Johnson, TODAY 2021/2/1 20:38
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected voidCopy configuration from the other AbstractBeanFactoryBasedTargetSource object.booleanReturn the owning BeanFactory.Return the name of the target bean in the factory.Class<?>Return the type of targets returned by thisTargetSource.inthashCode()booleanisStatic()Will all calls toTargetSource.getTarget()return the same object?voidreleaseTarget(Object target) Release the given target object obtained from theTargetSource.getTarget()method, if any.voidsetBeanFactory(BeanFactory beanFactory) Set the owning BeanFactory.voidsetTargetBeanName(String targetBeanName) Set the name of the target bean in the factory.voidsetTargetClass(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).toString()从接口继承的方法 cn.taketoday.aop.TargetSource
getTarget
-
字段详细资料
-
logger
-
-
构造器详细资料
-
AbstractBeanFactoryTargetSource
public AbstractBeanFactoryTargetSource()
-
-
方法详细资料
-
setTargetBeanName
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- 另请参阅:
-
getTargetBeanName
Return the name of the target bean in the factory. -
setTargetClass
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
getTypecall on the BeanFactory (or even a fullgetBeancall as fallback). -
setBeanFactory
Set the owning BeanFactory. We need to save a reference so that we can use thegetBeanmethod on every invocation.- 指定者:
setBeanFactory在接口中BeanFactoryAware
-
getBeanFactory
Return the owning BeanFactory. -
getTargetClass
从接口复制的说明:TargetSourceReturn the type of targets returned by thisTargetSource.Can return
null, although certain usages of aTargetSourcemight just work with a predetermined target class.- 指定者:
getTargetClass在接口中TargetClassAware- 指定者:
getTargetClass在接口中TargetSource- 返回:
- the type of targets returned by this
TargetSource
-
isStatic
public boolean isStatic()从接口复制的说明:TargetSourceWill all calls toTargetSource.getTarget()return the same object?In that case, there will be no need to invoke
TargetSource.releaseTarget(Object), and the AOP framework can cache the return value ofTargetSource.getTarget().- 指定者:
isStatic在接口中TargetSource- 返回:
trueif the target is immutable- 另请参阅:
-
releaseTarget
从接口复制的说明:TargetSourceRelease the given target object obtained from theTargetSource.getTarget()method, if any.default is: Nothing to release.
- 指定者:
releaseTarget在接口中TargetSource- 参数:
target- object obtained from a call toTargetSource.getTarget()- 抛出:
Exception- if the object can't be released
-
copyFrom
Copy configuration from the other AbstractBeanFactoryBasedTargetSource object. Subclasses should override this if they wish to expose it.- 参数:
other- object to copy configuration from
-
equals
-
hashCode
public int hashCode() -
toString
-