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

java.lang.Object
  extended byorg.springframework.aop.framework.autoproxy.target.AbstractPrototypeBasedTargetSourceCreator
      extended byorg.springframework.aop.framework.autoproxy.target.AbstractPoolingTargetSourceCreator
All Implemented Interfaces:
TargetSourceCreator
Direct Known Subclasses:
AttributesPoolingTargetSourceCreator

public abstract class AbstractPoolingTargetSourceCreator
extends AbstractPrototypeBasedTargetSourceCreator

Convenient superclass for TargetSource creators that create pooling TargetSources.

Author:
Rod Johnson
See Also:
AbstractPoolingTargetSource, CommonsPoolTargetSource

Field Summary
 
Fields inherited from class org.springframework.aop.framework.autoproxy.target.AbstractPrototypeBasedTargetSourceCreator
logger
 
Constructor Summary
AbstractPoolingTargetSourceCreator()
           
 
Method Summary
protected  AbstractPrototypeBasedTargetSource createPrototypeTargetSource(Object bean, String beanName, BeanFactory factory)
          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(Object bean, String beanName, BeanFactory beanFactory)
          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.AbstractPrototypeBasedTargetSourceCreator
getTargetSource
 
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

createPrototypeTargetSource

protected final AbstractPrototypeBasedTargetSource createPrototypeTargetSource(Object bean,
                                                                               String beanName,
                                                                               BeanFactory factory)
Description copied from class: AbstractPrototypeBasedTargetSourceCreator
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's implementation of getTargetSource() will do that.

Specified by:
createPrototypeTargetSource in class AbstractPrototypeBasedTargetSourceCreator
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 behaviour. Don't need to set bean name or call setBeanFactory.

See Also:
CommonsPoolTargetSource

getPoolingAttribute

protected abstract PoolingAttribute getPoolingAttribute(Object bean,
                                                        String beanName,
                                                        BeanFactory beanFactory)
Create a PoolingAttribute for the given bean, if any.

Parameters:
bean - the bean to create a PoolingAttribute for
beanName - the name of the bean
beanFactory - the current bean factory
Returns:
the PoolingAttribute, or null for no pooling


Copyright (C) 2003-2004 The Spring Framework Project.