org.springframework.aop.target.ThreadLocalTargetSource Java Examples

The following examples show how to use org.springframework.aop.target.ThreadLocalTargetSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QuickTargetSourceCreator.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Override
@Nullable
protected final AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(
		Class<?> beanClass, String beanName) {

	if (beanName.startsWith(PREFIX_COMMONS_POOL)) {
		CommonsPool2TargetSource cpts = new CommonsPool2TargetSource();
		cpts.setMaxSize(25);
		return cpts;
	}
	else if (beanName.startsWith(PREFIX_THREAD_LOCAL)) {
		return new ThreadLocalTargetSource();
	}
	else if (beanName.startsWith(PREFIX_PROTOTYPE)) {
		return new PrototypeTargetSource();
	}
	else {
		// No match. Don't create a custom target source.
		return null;
	}
}
 
Example #2
Source File: QuickTargetSourceCreator.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected final AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(
		Class<?> beanClass, String beanName) {

	if (beanName.startsWith(PREFIX_COMMONS_POOL)) {
		CommonsPool2TargetSource cpts = new CommonsPool2TargetSource();
		cpts.setMaxSize(25);
		return cpts;
	}
	else if (beanName.startsWith(PREFIX_THREAD_LOCAL)) {
		return new ThreadLocalTargetSource();
	}
	else if (beanName.startsWith(PREFIX_PROTOTYPE)) {
		return new PrototypeTargetSource();
	}
	else {
		// No match. Don't create a custom target source.
		return null;
	}
}