org.springframework.aop.target
Class AbstractPrototypeBasedTargetSource
java.lang.Object
   org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
       org.springframework.aop.target.AbstractPrototypeBasedTargetSource
org.springframework.aop.target.AbstractPrototypeBasedTargetSource
- All Implemented Interfaces: 
- Serializable, TargetClassAware, TargetSource, BeanFactoryAware
- Direct Known Subclasses: 
- AbstractPoolingTargetSource, PrototypeTargetSource, ThreadLocalTargetSource
- public abstract class AbstractPrototypeBasedTargetSource 
- extends AbstractBeanFactoryBasedTargetSource
Base class for dynamic TargetSources that can 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 AbstractBeanFactoryBasedTargetSource.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
- BeanFactory.getBean(java.lang.String),- PrototypeTargetSource,- ThreadLocalTargetSource,- CommonsPoolTargetSource, 
Serialized Form
 
 
 
 
| Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource | 
| copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setTargetBeanName, setTargetClass, toString, writeReplace | 
 
 
 
AbstractPrototypeBasedTargetSource
public AbstractPrototypeBasedTargetSource()
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
- Description copied from class: AbstractBeanFactoryBasedTargetSource
- Set the owning BeanFactory. We need to save a reference so that we can
 use the getBeanmethod on every invocation.
 
- 
- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Overrides:
- setBeanFactoryin class- AbstractBeanFactoryBasedTargetSource
 
- 
- Parameters:
- beanFactory- owning BeanFactory (never- null).
 The bean can immediately call methods on the factory.
- Throws:
- BeansException- in case of initialization errors
- See Also:
- BeanInitializationException
 
newPrototypeInstance
protected Object newPrototypeInstance()
                               throws BeansException
- Subclasses should call this method to create a new prototype instance.
 
- 
- Throws:
- BeansException- if bean creation failed
 
destroyPrototypeInstance
protected void destroyPrototypeInstance(Object target)
- Subclasses should call this method to destroy an obsolete prototype instance.
 
- 
- Parameters:
- target- the bean instance to destroy
 
Copyright © 2002-2008 The Spring Framework.