站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

AbstractPoolingTargetSourceCreator (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.aop.framework.autoproxy.target
Class AbstractPoolingTargetSourceCreator

java.lang.Object
  extended by org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
      extended by org.springframework.aop.framework.autoproxy.target.AbstractPoolingTargetSourceCreator
All Implemented Interfaces:
TargetSourceCreator, BeanFactoryAware, DisposableBean
Direct Known Subclasses:
AttributesPoolingTargetSourceCreator

public abstract class AbstractPoolingTargetSourceCreator
extends AbstractBeanFactoryBasedTargetSourceCreator

Convenient superclass for TargetSource creators that create pooling TargetSources.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AbstractPoolingTargetSource, CommonsPoolTargetSource

Field Summary
 
Fields inherited from class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
logger
 
Constructor Summary
AbstractPoolingTargetSourceCreator()
           
 
Method Summary
protected  AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(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, or null if they are not interested it in, in which case no special target source will be created.
protected abstract  PoolingAttribute getPoolingAttribute(Class beanClass, String beanName)
          Create a PoolingAttribute for the given bean, if any.
protected  AbstractPoolingTargetSource newPoolingTargetSource(PoolingAttribute poolingAttribute)
          Create a new AbstractPoolingTargetSource.
 
Methods inherited from class org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator
destroy, getBeanFactory, getTargetSource, isPrototypeBased, setBeanFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPoolingTargetSourceCreator

public AbstractPoolingTargetSourceCreator()
Method Detail

createBeanFactoryBasedTargetSource

protected final AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(Class beanClass,
                                                                                        String beanName)
Description copied from class: AbstractBeanFactoryBasedTargetSourceCreator
Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource if they wish to create a custom TargetSource for this bean, or null if they are not interested it in, in which case no special target source will be created. Subclasses should not call setTargetBeanName or setBeanFactory on the AbstractPrototypeBasedTargetSource: This class' implementation of getTargetSource() will do that.

Specified by:
createBeanFactoryBasedTargetSource in class AbstractBeanFactoryBasedTargetSourceCreator
Parameters:
beanClass - the class of the bean to create a TargetSource for
beanName - the name of the bean
Returns:
the AbstractPrototypeBasedTargetSource, or null if we don't match this

newPoolingTargetSource

protected AbstractPoolingTargetSource newPoolingTargetSource(PoolingAttribute poolingAttribute)
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).

The created AbstractPoolingTargetSource does not have to be configured, This will all be handled by this TargetSourceCreator and its base class.

See Also:
CommonsPoolTargetSource

getPoolingAttribute

protected abstract PoolingAttribute getPoolingAttribute(Class beanClass,
                                                        String beanName)
Create a PoolingAttribute for the given bean, if any.

Parameters:
beanClass - the class of the bean to create a TargetSource for
beanName - the name of the bean
Returns:
the PoolingAttribute, or null for no pooling


Copyright (c) 2002-2007 The Spring Framework Project.