|
spring-aop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
org.springframework.aop.target.AbstractPrototypeBasedTargetSource
public abstract class AbstractPrototypeBasedTargetSource
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 AbstractBeanFactoryBasedTargetSource
.
BeanFactory.getBean(java.lang.String)
,
PrototypeTargetSource
,
ThreadLocalTargetSource
,
CommonsPoolTargetSource
,
Serialized FormField Summary |
---|
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource |
---|
logger |
Constructor Summary | |
---|---|
AbstractPrototypeBasedTargetSource()
|
Method Summary | |
---|---|
protected void |
destroyPrototypeInstance(java.lang.Object target)
Subclasses should call this method to destroy an obsolete prototype instance. |
protected java.lang.Object |
newPrototypeInstance()
Subclasses should call this method to create a new prototype instance. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Set the owning BeanFactory. |
protected java.lang.Object |
writeReplace()
Replaces this object with a SingletonTargetSource on serialization. |
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource |
---|
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setTargetBeanName, setTargetClass, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.aop.TargetSource |
---|
getTarget |
Constructor Detail |
---|
public AbstractPrototypeBasedTargetSource()
Method Detail |
---|
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
AbstractBeanFactoryBasedTargetSource
getBean
method on every invocation.
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
setBeanFactory
in class AbstractBeanFactoryBasedTargetSource
org.springframework.beans.BeansException
protected java.lang.Object newPrototypeInstance() throws org.springframework.beans.BeansException
org.springframework.beans.BeansException
- if bean creation failedprotected void destroyPrototypeInstance(java.lang.Object target)
target
- the bean instance to destroyprotected java.lang.Object writeReplace() throws java.io.ObjectStreamException
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.
java.io.ObjectStreamException
|
spring-aop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |