Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » aop » target » [javadoc | source]
org.springframework.aop.target
abstract public class: AbstractPoolingTargetSource [javadoc | source]
java.lang.Object
   org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
      org.springframework.aop.target.AbstractPrototypeBasedTargetSource
         org.springframework.aop.target.AbstractPoolingTargetSource

All Implemented Interfaces:
    DisposableBean, PoolingConfig, TargetSource, BeanFactoryAware, Serializable

Direct Known Subclasses:
    CommonsPoolTargetSource

Abstract base class for pooling org.springframework.aop.TargetSource implementations which maintain a pool of target instances, acquiring and releasing a target object from the pool for each method invocation. This abstract base class is independent of concrete pooling technology; see the subclass CommonsPoolTargetSource for a concrete example.

Subclasses must implement the #getTarget and #releaseTarget methods based on their chosen object pool. The #newPrototypeInstance() method inherited from AbstractPrototypeBasedTargetSource can be used to create objects in order to put them into the pool.

Subclasses must also implement some of the monitoring methods from the PoolingConfig interface. The #getPoolingConfigMixin() method makes these stats available on proxied objects through an IntroductionAdvisor.

This class implements the org.springframework.beans.factory.DisposableBean interface in order to force subclasses to implement a #destroy() method, closing down their object pool.

Fields inherited from org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource:
logger
Method from org.springframework.aop.target.AbstractPoolingTargetSource Summary:
createPool,   getMaxSize,   getPoolingConfigMixin,   getTarget,   releaseTarget,   setBeanFactory,   setMaxSize
Methods from org.springframework.aop.target.AbstractPrototypeBasedTargetSource:
destroyPrototypeInstance,   newPrototypeInstance,   setBeanFactory
Methods from org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource:
copyFrom,   equals,   getBeanFactory,   getTargetBeanName,   getTargetClass,   hashCode,   isStatic,   releaseTarget,   setBeanFactory,   setTargetBeanName,   setTargetClass,   toString,   writeReplace
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.aop.target.AbstractPoolingTargetSource Detail:
 abstract protected  void createPool() throws Exception
    Create the pool.
 public int getMaxSize() 
    Return the maximum size of the pool.
 public DefaultIntroductionAdvisor getPoolingConfigMixin() 
    Return an IntroductionAdvisor that providing a mixin exposing statistics about the pool maintained by this object.
 abstract public Object getTarget() throws Exception
    Acquire an object from the pool.
 abstract public  void releaseTarget(Object target) throws Exception
    Return the given object to the pool.
 public final  void setBeanFactory(BeanFactory beanFactory) throws BeansException 
 public  void setMaxSize(int maxSize) 
    Set the maximum size of the pool. Default is -1, indicating no size limit.