Class QuickTargetSourceCreator
java.lang.Object
org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
org.springframework.aop.framework.autoproxy.target.QuickTargetSourceCreator
- All Implemented Interfaces:
TargetSourceCreator, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean
Convenient TargetSourceCreator using bean name prefixes to create one of three
well-known TargetSource types:
- : CommonsPool2TargetSource
- % ThreadLocalTargetSource
- ! PrototypeTargetSource
- Author:
- Rod Johnson, Stephane Nicoll
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CommonsPool2TargetSource prefix.static final StringThe PrototypeTargetSource prefix.static final StringThe ThreadLocalTargetSource prefix.Fields inherited from class AbstractBeanFactoryBasedTargetSourceCreator
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final @Nullable AbstractBeanFactoryBasedTargetSourcecreateBeanFactoryBasedTargetSource(Class<?> beanClass, String beanName) Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, ornullif they are not interested it in, in which case no special target source will be created.Methods inherited from class AbstractBeanFactoryBasedTargetSourceCreator
buildInternalBeanFactory, destroy, getBeanFactory, getInternalBeanFactoryForBean, getTargetSource, isPrototypeBased, setBeanFactory
-
Field Details
-
PREFIX_COMMONS_POOL
-
PREFIX_THREAD_LOCAL
-
PREFIX_PROTOTYPE
-
-
Constructor Details
-
QuickTargetSourceCreator
public QuickTargetSourceCreator()
-
-
Method Details
-
createBeanFactoryBasedTargetSource
protected final @Nullable AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(Class<?> beanClass, String beanName) Description copied from class:AbstractBeanFactoryBasedTargetSourceCreatorSubclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, ornullif they are not interested it in, in which case no special target source will be created. Subclasses should not callsetTargetBeanNameorsetBeanFactoryon the AbstractPrototypeBasedTargetSource: This class' implementation ofgetTargetSource()will do that.- Specified by:
createBeanFactoryBasedTargetSourcein classAbstractBeanFactoryBasedTargetSourceCreator- Parameters:
beanClass- the class of the bean to create a TargetSource forbeanName- the name of the bean- Returns:
- the AbstractPrototypeBasedTargetSource, or
nullif we don't match this
-