Class AbstractPoolingTargetSource

    • Constructor Detail

      • AbstractPoolingTargetSource

        public AbstractPoolingTargetSource()
    • Method Detail

      • setMaxSize

        public void setMaxSize(int maxSize)
        Set the maximum size of the pool. Default is -1, indicating no size limit.
      • getMaxSize

        public int getMaxSize()
        Return the maximum size of the pool.
        Specified by:
        getMaxSize in interface PoolingConfig
      • createPool

        protected abstract void createPool()
                                    throws java.lang.Exception
        Create the pool.
        java.lang.Exception - to avoid placing constraints on pooling APIs
      • getTarget

        public abstract java.lang.Object getTarget()
                                                      throws java.lang.Exception
        Acquire an object from the pool.
        Specified by:
        getTarget in interface TargetSource
        an object from the pool
        java.lang.Exception - we may need to deal with checked exceptions from pool APIs, so we're forgiving with our exception signature
      • releaseTarget

        public abstract void releaseTarget(java.lang.Object target)
                                    throws java.lang.Exception
        Return the given object to the pool.
        Specified by:
        releaseTarget in interface TargetSource
        releaseTarget in class AbstractBeanFactoryBasedTargetSource
        target - object that must have been acquired from the pool via a call to getTarget()
        java.lang.Exception - to allow pooling APIs to throw exception
        See Also:
      • getPoolingConfigMixin

        public DefaultIntroductionAdvisor getPoolingConfigMixin()
        Return an IntroductionAdvisor that providing a mixin exposing statistics about the pool maintained by this object.