org.springframework.aop.target
Class AbstractPrototypeTargetSource

Direct Known Subclasses:
AbstractPoolingTargetSource, PrototypeTargetSource, ThreadLocalTargetSource

public abstract class AbstractPrototypeTargetSource
implements BeanFactoryAware, InitializingBean, TargetSource

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.

Author:
Rod Johnson
Version: $Id: AbstractPrototypeTargetSource.java,v 1.3 2003/12/30 04:32:26 dkopylenko Exp $

Method Summary
 voidafterPropertiesSet()
           
 final StringgetTargetBeanName()
           
 final ClassgetTargetClass()
           
 final booleanisStatic()
           
 voidsetBeanFactory(BeanFactory beanFactory)
          Set the owning BeanFactory.
 final voidsetTargetBeanName(String targetBeanName)
          Set the name of the target bean in the factory.

Method Detail

afterPropertiesSet

public void afterPropertiesSet()
throws java.lang.Exception
See Also:
org.springframework.beans.factory.InitializingBean.afterPropertiesSet()

getTargetBeanName

public final String getTargetBeanName()

getTargetClass

public final Class getTargetClass()
See Also:
org.springframework.aop.TargetSource.getTargetClass()

isStatic

public final boolean isStatic()
See Also:
org.springframework.aop.TargetSource.isStatic()

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
throws org.springframework.beans.BeansException
Set the owning BeanFactory. We need to save a reference so that we can use the getBean() method on every invocation.

setTargetBeanName

public final void setTargetBeanName(String targetBeanName)
Set the name of the target bean in the factory. This bean should be a prototype, or the same instance will always be obtained from the factory, resulting in the same behaviour as the InvokerInterceptor
Parameters:
targetBeanName name - of the target bean in the BeanFactory that owns this interceptor.

Association Links

to Class java.lang.String

Name of the target bean we will create on each invocation

to Class org.springframework.beans.factory.BeanFactory

BeanFactory that owns this TargetSource. We need to hold onto this reference so that we can create new prototype instances as necessary.

to Class java.lang.Class

Class of the target