程序包 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
直接已知子类:
AbstractPoolingTargetSource, PrototypeTargetSource, ThreadLocalTargetSource

public abstract class AbstractPrototypeTargetSource extends AbstractBeanFactoryTargetSource
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
另请参阅:
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
  • 构造器详细资料

    • AbstractPrototypeTargetSource

      public AbstractPrototypeTargetSource()
  • 方法详细资料

    • setBeanFactory

      public void setBeanFactory(infra.beans.factory.BeanFactory beanFactory) throws infra.beans.BeansException
      从类复制的说明: AbstractBeanFactoryTargetSource
      Set the owning BeanFactory. We need to save a reference so that we can use the getBean method on every invocation.
      指定者:
      setBeanFactory 在接口中 infra.beans.factory.BeanFactoryAware
      覆盖:
      setBeanFactory 在类中 AbstractBeanFactoryTargetSource
      抛出:
      infra.beans.BeansException
    • newPrototypeInstance

      protected Object newPrototypeInstance()
      Subclasses should call this method to create a new prototype instance.
    • destroyPrototypeInstance

      protected void destroyPrototypeInstance(Object target)
      Subclasses should call this method to destroy an obsolete prototype instance.
      参数:
      target - the bean instance to destroy
    • readObject

      private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException
      抛出:
      IOException
      ClassNotFoundException
    • writeReplace

      protected Object writeReplace() throws ObjectStreamException
      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.

      抛出:
      ObjectStreamException