`
ppxieppp
  • 浏览: 51031 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

numTestsPerEvictionRun 参数源码

阅读更多

package org.apache.commons.pool.impl

 

public class GenericObjectPool<T> extends BaseObjectPool<T> implements ObjectPool<T>

 

    /** 

     * Returns the number of tests to be performed in an Evictor run,

     * based on the current value of <code>numTestsPerEvictionRun</code>

     * and the number of idle instances in the pool.

     * 

     * @see #setNumTestsPerEvictionRun

     * @return the number of tests for the Evictor to run

     */

    private int getNumTests() {

        if(_numTestsPerEvictionRun >= 0) {

            return Math.min(_numTestsPerEvictionRun, _pool.size());

        } else {

            return(int)(Math.ceil(_pool.size()/Math.abs((double)_numTestsPerEvictionRun)));

        }

    }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics