/** * Create a new AbstractPoolingTargetSource. This implementation creates a * CommonsPoolTargetSource, but subclasses may wish to override that behavior * (potentially even using different pools for specific PoolingAttribute subclasses). * <p>The created AbstractPoolingTargetSource does not have to be configured, * This will all be handled by this TargetSourceCreator and its base class. * @see org.springframework.aop.target.CommonsPoolTargetSource */ protected AbstractPoolingTargetSource newPoolingTargetSource(PoolingAttribute poolingAttribute) { return new CommonsPoolTargetSource(); }
protected final AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource( Class beanClass, String beanName) { if (beanName.startsWith(PREFIX_COMMONS_POOL)) { CommonsPoolTargetSource cpts = new CommonsPoolTargetSource(); 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; } }