亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? genericobjectpool.java

?? 一個基于lucene&heritrix的搜索引擎
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
     * idle object evictor thread (if any).     *     * @see #setNumTestsPerEvictionRun     * @see #setTimeBetweenEvictionRunsMillis     */    public synchronized int getNumTestsPerEvictionRun() {        return _numTestsPerEvictionRun;    }    /**     * Sets the max number of objects to examine during each run of the     * idle object evictor thread (if any).     * <p>     * When a negative value is supplied, <tt>ceil({@link #getNumIdle})/abs({@link #getNumTestsPerEvictionRun})</tt>     * tests will be run.  I.e., when the value is <i>-n</i>, roughly one <i>n</i>th of the     * idle objects will be tested per run.     *     * @see #getNumTestsPerEvictionRun     * @see #setTimeBetweenEvictionRunsMillis     */    public synchronized void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) {        _numTestsPerEvictionRun = numTestsPerEvictionRun;    }    /**     * Returns the minimum amount of time an object may sit idle in the pool     * before it is eligable for eviction by the idle object evictor     * (if any).     *     * @see #setMinEvictableIdleTimeMillis     * @see #setTimeBetweenEvictionRunsMillis     */    public synchronized long getMinEvictableIdleTimeMillis() {        return _minEvictableIdleTimeMillis;    }    /**     * Sets the minimum amount of time an object may sit idle in the pool     * before it is eligable for eviction by the idle object evictor     * (if any).     * When non-positive, no objects will be evicted from the pool     * due to idle time alone.     *     * @see #getMinEvictableIdleTimeMillis     * @see #setTimeBetweenEvictionRunsMillis     */    public synchronized void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {        _minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;    }    /**     * Returns the minimum amount of time an object may sit idle in the pool     * before it is eligable for eviction by the idle object evictor     * (if any), with the extra condition that at least     * "minIdle" amount of object remain in the pool.     *     * @see #setSoftMinEvictableIdleTimeMillis     */    public synchronized long getSoftMinEvictableIdleTimeMillis() {        return _softMinEvictableIdleTimeMillis;    }    /**     * Sets the minimum amount of time an object may sit idle in the pool     * before it is eligable for eviction by the idle object evictor     * (if any), with the extra condition that at least     * "minIdle" amount of object remain in the pool.     * When non-positive, no objects will be evicted from the pool     * due to idle time alone.     *     * @see #getSoftMinEvictableIdleTimeMillis     */    public synchronized void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis) {        _softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;    }    /**     * When <tt>true</tt>, objects will be     * {@link PoolableObjectFactory#validateObject validated}     * by the idle object evictor (if any).  If an object     * fails to validate, it will be dropped from the pool.     *     * @see #setTestWhileIdle     * @see #setTimeBetweenEvictionRunsMillis     */    public synchronized boolean getTestWhileIdle() {        return _testWhileIdle;    }    /**     * When <tt>true</tt>, objects will be     * {@link PoolableObjectFactory#validateObject validated}     * by the idle object evictor (if any).  If an object     * fails to validate, it will be dropped from the pool.     *     * @see #getTestWhileIdle     * @see #setTimeBetweenEvictionRunsMillis     */    public synchronized void setTestWhileIdle(boolean testWhileIdle) {        _testWhileIdle = testWhileIdle;    }    /**     * Sets my configuration.     * @see GenericObjectPool.Config     */    public synchronized void setConfig(GenericObjectPool.Config conf) {        setMaxIdle(conf.maxIdle);        setMinIdle(conf.minIdle);        setMaxActive(conf.maxActive);        setMaxWait(conf.maxWait);        setWhenExhaustedAction(conf.whenExhaustedAction);        setTestOnBorrow(conf.testOnBorrow);        setTestOnReturn(conf.testOnReturn);        setTestWhileIdle(conf.testWhileIdle);        setNumTestsPerEvictionRun(conf.numTestsPerEvictionRun);        setMinEvictableIdleTimeMillis(conf.minEvictableIdleTimeMillis);        setTimeBetweenEvictionRunsMillis(conf.timeBetweenEvictionRunsMillis);        notifyAll();    }    //-- ObjectPool methods ------------------------------------------    public synchronized Object borrowObject() throws Exception {        assertOpen();        long starttime = System.currentTimeMillis();        for(;;) {            ObjectTimestampPair pair = null;            // if there are any sleeping, just grab one of those            try {                pair = (ObjectTimestampPair)(_pool.removeFirst());            } catch(NoSuchElementException e) {                ; /* ignored */            }            // otherwise            if(null == pair) {                // check if we can create one                // (note we know that the num sleeping is 0, else we wouldn't be here)                if(_maxActive < 0 || _numActive < _maxActive) {                    // allow new object to be created                } else {                    // the pool is exhausted                    switch(_whenExhaustedAction) {                        case WHEN_EXHAUSTED_GROW:                            // allow new object to be created                            break;                        case WHEN_EXHAUSTED_FAIL:                            throw new NoSuchElementException("Pool exhausted");                        case WHEN_EXHAUSTED_BLOCK:                            try {                                if(_maxWait <= 0) {                                    wait();                                } else {                                    // this code may be executed again after a notify then continue cycle                                    // so, need to calculate the amount of time to wait                                    final long elapsed = (System.currentTimeMillis() - starttime);                                    final long waitTime = _maxWait - elapsed;                                    if (waitTime > 0)                                    {                                        wait(waitTime);                                    }                                }                            } catch(InterruptedException e) {                                // ignored                            }                            if(_maxWait > 0 && ((System.currentTimeMillis() - starttime) >= _maxWait)) {                                throw new NoSuchElementException("Timeout waiting for idle object");                            } else {                                continue; // keep looping                            }                        default:                            throw new IllegalArgumentException("WhenExhaustedAction property " + _whenExhaustedAction + " not recognized.");                    }                }            }            _numActive++;            // create new object when needed            boolean newlyCreated = false;            if(null == pair) {                try {                    Object obj = _factory.makeObject();                    pair = new ObjectTimestampPair(obj);                    newlyCreated = true;                } finally {                    if (!newlyCreated) {                        // object cannot be created                        _numActive--;                        notifyAll();                    }                }            }            // activate & validate the object            try {                _factory.activateObject(pair.value);                if(_testOnBorrow && !_factory.validateObject(pair.value)) {                    throw new Exception("ValidateObject failed");                }                return pair.value;            }            catch (Throwable e) {                // object cannot be activated or is invalid                _numActive--;                notifyAll();                try {                    _factory.destroyObject(pair.value);                }                catch (Throwable e2) {                    // cannot destroy broken object                }                if(newlyCreated) {                    throw new NoSuchElementException("Could not create a validated object, cause: " + e.getMessage());                }                else {                    continue; // keep looping                }            }        }    }    public synchronized void invalidateObject(Object obj) throws Exception {        assertOpen();        try {            _factory.destroyObject(obj);        }        finally {            _numActive--;            notifyAll(); // _numActive has changed        }    }    public synchronized void clear() {        assertOpen();        for(Iterator it = _pool.iterator(); it.hasNext(); ) {            try {                _factory.destroyObject(((ObjectTimestampPair)(it.next())).value);            } catch(Exception e) {                // ignore error, keep destroying the rest            }            it.remove();        }        _pool.clear();        notifyAll(); // num sleeping has changed    }    public synchronized int getNumActive() {        assertOpen();        return _numActive;    }    public synchronized int getNumIdle() {        assertOpen();        return _pool.size();    }    public synchronized void returnObject(Object obj) throws Exception {        assertOpen();        addObjectToPool(obj, true);    }    private void addObjectToPool(Object obj, boolean decrementNumActive) throws Exception {        boolean success = true;        if(_testOnReturn && !(_factory.validateObject(obj))) {            success = false;        } else {            try {                _factory.passivateObject(obj);            } catch(Exception e) {                success = false;            }        }        boolean shouldDestroy = !success;        if (decrementNumActive) {            _numActive--;        }        if((_maxIdle >= 0) && (_pool.size() >= _maxIdle)) {            shouldDestroy = true;        } else if(success) {            _pool.addLast(new ObjectTimestampPair(obj));        }        notifyAll(); // _numActive has changed        if(shouldDestroy) {            try {                _factory.destroyObject(obj);            } catch(Exception e) {                // ignored            }        }    }    public synchronized void close() throws Exception {        clear();        _pool = null;        _factory = null;        startEvictor(-1L);        super.close();    }    public synchronized void setFactory(PoolableObjectFactory factory) throws IllegalStateException {        assertOpen();        if(0 < getNumActive()) {            throw new IllegalStateException("Objects are already active");        } else {            clear();            _factory = factory;        }    }    public synchronized void evict() throws Exception {        assertOpen();        if(!_pool.isEmpty()) {            ListIterator iter;            if (evictLastIndex < 0) {                iter = _pool.listIterator(_pool.size());            } else {                iter = _pool.listIterator(evictLastIndex);            }            for(int i=0,m=getNumTests();i<m;i++) {                if(!iter.hasPrevious()) {                    iter = _pool.listIterator(_pool.size());                }                boolean removeObject = false;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区在线| 亚洲伊人伊色伊影伊综合网| 亚洲人妖av一区二区| 丝袜美腿亚洲综合| 97se亚洲国产综合在线| 欧美一级理论片| 亚洲精选在线视频| 国产成人av电影免费在线观看| 欧美精品精品一区| 亚洲在线视频网站| kk眼镜猥琐国模调教系列一区二区| 日韩欧美在线不卡| 性做久久久久久| 91精品福利在线| 中文字幕字幕中文在线中不卡视频| 精品制服美女久久| 欧美电影免费观看高清完整版| 亚洲影院免费观看| 在线观看精品一区| 一区二区三区在线免费播放| av爱爱亚洲一区| 国产精品久久久久三级| 国产乱理伦片在线观看夜一区| 欧美电影免费观看高清完整版在线观看 | 国产日产欧美一区| 国产精品免费久久久久| 亚洲欧美视频一区| 欧美中文字幕一区二区三区| 国产欧美一区二区精品久导航 | 国产精品一二三在| 色综合久久综合网97色综合 | 国产精品国产三级国产a| 美美哒免费高清在线观看视频一区二区 | 91精品国产综合久久精品图片 | 日本道在线观看一区二区| 337p亚洲精品色噜噜| 国产精品卡一卡二卡三| 国产精品资源在线看| 精品久久国产97色综合| 婷婷国产在线综合| 欧美日韩午夜在线视频| 一区二区高清在线| 一本到不卡精品视频在线观看| 国产欧美日韩在线视频| 国产真实乱子伦精品视频| 欧美一区二区久久久| 日韩影院在线观看| 欧美高清视频www夜色资源网| 亚洲美女屁股眼交| 色素色在线综合| 国产精品人成在线观看免费 | 欧美日韩极品在线观看一区| 一区二区三区四区在线| 在线观看视频一区二区| 亚洲影院在线观看| 欧美日韩一本到| 性做久久久久久免费观看欧美| 欧美日韩国产免费| 日本免费新一区视频| 欧美xxxx老人做受| 国产精品一区二区黑丝| 日本一区二区三区电影| 91麻豆国产香蕉久久精品| 亚洲欧美国产77777| 欧美午夜精品久久久| 天天影视涩香欲综合网| 欧美成人video| 成人福利视频在线| 夜夜爽夜夜爽精品视频| 欧美美女bb生活片| 国产一区欧美日韩| 中文字幕精品三区| 成人听书哪个软件好| 国产精品久久久爽爽爽麻豆色哟哟| 99re在线视频这里只有精品| 一区二区三区色| 日韩欧美一二三| 99久久免费视频.com| 亚洲午夜激情av| 久久久久久**毛片大全| 91丝袜美腿高跟国产极品老师| 午夜激情一区二区三区| 久久久精品tv| 欧美视频中文字幕| 国产精选一区二区三区| 亚洲美女免费视频| 日韩欧美一级片| 一本色道**综合亚洲精品蜜桃冫| 青青草97国产精品免费观看| 国产欧美精品一区二区色综合 | 色av综合在线| 亚洲成人精品影院| 久久久久久久精| 欧美日韩在线精品一区二区三区激情 | 在线观看不卡一区| 国产精品影音先锋| 午夜精品福利一区二区三区蜜桃| 久久久国产精品麻豆| 欧美日韩黄视频| 不卡的av在线| 韩国在线一区二区| 视频一区二区三区中文字幕| 久久久天堂av| 欧美麻豆精品久久久久久| 成人黄色777网| 久久国产精品72免费观看| 亚洲综合男人的天堂| 国产农村妇女毛片精品久久麻豆| 6080日韩午夜伦伦午夜伦| 成人黄色小视频在线观看| 精品亚洲免费视频| 日本女人一区二区三区| 亚洲激情男女视频| 国产精品每日更新| 久久久久国产精品麻豆| 日韩欧美卡一卡二| 欧美人动与zoxxxx乱| 欧美中文字幕一区二区三区亚洲| 成人高清伦理免费影院在线观看| 国产一区美女在线| 国产美女精品一区二区三区| 日韩成人精品在线观看| 亚洲成人免费影院| 五月激情六月综合| 午夜成人免费视频| 午夜精品久久久久| 日韩精品久久理论片| 亚洲国产精品天堂| 亚洲国产美女搞黄色| 亚洲v中文字幕| 日韩精品每日更新| 蜜桃视频免费观看一区| 亚洲高清视频在线| 亚洲你懂的在线视频| 国产精品理伦片| 欧美不卡一区二区三区四区| 中文天堂在线一区| 亚洲欧美日韩一区| 一区二区三区产品免费精品久久75| 亚洲欧美综合色| 亚洲卡通动漫在线| 亚洲国产va精品久久久不卡综合| 亚洲自拍偷拍图区| 午夜精品久久久久久久 | 成人午夜电影久久影院| 国产精品自拍一区| 97精品久久久午夜一区二区三区| 色综合色综合色综合| 欧美影院午夜播放| 日韩亚洲电影在线| 久久精品男人天堂av| 中文字幕在线观看一区| 亚洲一二三专区| 久久99国产精品麻豆| 成人综合在线网站| 欧美专区日韩专区| 欧美一级电影网站| 国产精品视频一二三| 国产精品免费av| 日韩和的一区二区| 国产成人在线视频免费播放| 色哟哟欧美精品| 精品国产一区二区在线观看| 亚洲图片激情小说| 一区二区三区电影在线播| 国产精品影音先锋| 欧美视频精品在线观看| 精品捆绑美女sm三区| 最新高清无码专区| 日本va欧美va精品| 成人高清视频在线| 欧美一级久久久久久久大片| 亚洲欧洲日韩av| 美女高潮久久久| 一本大道久久精品懂色aⅴ| 制服丝袜成人动漫| 国产精品国产馆在线真实露脸| 亚洲精品免费电影| 久久精品国产一区二区三 | 亚洲成av人片一区二区| 国产精品一区二区视频| 欧美日本在线播放| 中文字幕亚洲成人| 美女视频第一区二区三区免费观看网站 | 欧美日韩国产小视频| 中文一区在线播放| 美国欧美日韩国产在线播放| 成人黄色国产精品网站大全在线免费观看 | 亚洲天堂福利av| 国内成+人亚洲+欧美+综合在线| 91国偷自产一区二区使用方法| 666欧美在线视频| 亚洲国产精品一区二区久久恐怖片| 成人免费看黄yyy456| 欧美电影免费观看高清完整版 | 国产亚洲1区2区3区| 日本不卡不码高清免费观看| 在线亚洲+欧美+日本专区| 国产欧美一区二区精品久导航| 麻豆精品国产传媒mv男同|