程序包 infra.aop.target
类 AbstractPrototypeTargetSource
java.lang.Object
infra.aop.target.AbstractBeanFactoryTargetSource
infra.aop.target.AbstractPrototypeTargetSource
- 所有已实现的接口:
TargetClassAware,TargetSource,infra.beans.factory.Aware,infra.beans.factory.BeanFactoryAware,Serializable
Base class for dynamic
TargetSource implementations
that create new prototype bean instances to support a pooling or
new-instance-per-invocation strategy.
Such TargetSources must run in a BeanFactory, as it needs to
call the getBean method to create a new prototype instance.
Therefore, this base class extends AbstractBeanFactoryTargetSource.
- 从以下版本开始:
- 3.0
- 作者:
- Rod Johnson, Juergen Hoeller, TODAY 2021/2/1 20:40
- 另请参阅:
-
BeanFactory.getBean(java.lang.String)PrototypeTargetSourceThreadLocalTargetSource- 序列化表格
-
字段概要
字段从类继承的字段 infra.aop.target.AbstractBeanFactoryTargetSource
logger -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected voiddestroyPrototypeInstance(Object target) Subclasses should call this method to destroy an obsolete prototype instance.protected ObjectSubclasses should call this method to create a new prototype instance.private voidvoidsetBeanFactory(infra.beans.factory.BeanFactory beanFactory) Set the owning BeanFactory.protected ObjectReplaces this object with a SingletonTargetSource on serialization.从类继承的方法 infra.aop.target.AbstractBeanFactoryTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setTargetBeanName, setTargetClass, toString从接口继承的方法 infra.aop.TargetSource
getTarget
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
-
构造器详细资料
-
AbstractPrototypeTargetSource
public AbstractPrototypeTargetSource()
-
-
方法详细资料
-
setBeanFactory
public void setBeanFactory(infra.beans.factory.BeanFactory beanFactory) throws infra.beans.BeansException 从类复制的说明:AbstractBeanFactoryTargetSourceSet the owning BeanFactory. We need to save a reference so that we can use thegetBeanmethod on every invocation.- 指定者:
setBeanFactory在接口中infra.beans.factory.BeanFactoryAware- 覆盖:
setBeanFactory在类中AbstractBeanFactoryTargetSource- 抛出:
infra.beans.BeansException
-
newPrototypeInstance
Subclasses should call this method to create a new prototype instance. -
destroyPrototypeInstance
Subclasses should call this method to destroy an obsolete prototype instance.- 参数:
target- the bean instance to destroy
-
readObject
-
writeReplace
Replaces this object with a SingletonTargetSource on serialization. Protected as otherwise it won't be invoked for subclasses. (ThewriteReplace()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.
-