Package org.springframework.aop.target
Class PrototypeTargetSource
java.lang.Object
org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
org.springframework.aop.target.AbstractPrototypeBasedTargetSource
org.springframework.aop.target.PrototypeTargetSource
- All Implemented Interfaces:
Serializable,TargetClassAware,TargetSource,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware
TargetSource implementation that
creates a new instance of the target bean for each request,
destroying each instance on release (after each request).
Obtains bean instances from its containing
BeanFactory.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
logger -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.aop.target.AbstractPrototypeBasedTargetSource
destroyPrototypeInstance, newPrototypeInstance, setBeanFactory, writeReplaceMethods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, setTargetBeanName, setTargetClassMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.aop.TargetSource
isStatic
-
Constructor Details
-
PrototypeTargetSource
public PrototypeTargetSource()
-
-
Method Details
-
getTarget
Obtain a new prototype instance for every call.- Returns:
- the target object which contains the joinpoint,
or
nullif there is no actual target instance - Throws:
org.springframework.beans.BeansException- See Also:
-
releaseTarget
Destroy the given independent instance.- Parameters:
target- object obtained from a call toTargetSource.getTarget()- See Also:
-
toString
- Overrides:
toStringin classAbstractBeanFactoryBasedTargetSource
-