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

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

?? genericobjectpool.java

?? 爬蟲
?? 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一区二区三区免费野_久草精品视频
久久精品视频免费| 欧美一区二区视频观看视频| 国产精品小仙女| 精品影院一区二区久久久| 日韩成人午夜精品| 日本欧美一区二区三区| 青青草国产精品亚洲专区无| 蜜桃一区二区三区在线观看| 精品一区二区免费在线观看| 久久精品国产免费看久久精品| 九九精品视频在线看| 国产精品一区二区在线播放| 成人一区二区三区中文字幕| 波多野结衣在线一区| 91免费版在线| 在线亚洲+欧美+日本专区| 欧美主播一区二区三区美女| 欧美日韩国产在线播放网站| 88在线观看91蜜桃国自产| 日韩欧美123| 国产视频一区二区在线| 中文字幕一区日韩精品欧美| 亚洲美女淫视频| 五月婷婷综合网| 精品一区二区三区久久久| 成人免费看视频| 欧美在线观看你懂的| 91麻豆精品国产91久久久久久 | 国产精品久久久久久久久久久免费看 | 日韩一区二区在线播放| 久久久久久久国产精品影院| 中文字幕在线不卡视频| 五月激情丁香一区二区三区| 国内精品视频一区二区三区八戒 | 亚洲一线二线三线视频| 日本成人在线不卡视频| 国产999精品久久久久久| 欧美主播一区二区三区| 久久久青草青青国产亚洲免观| 亚洲日本中文字幕区| 免费不卡在线视频| 91网站在线观看视频| 欧美电视剧免费观看| 亚洲免费电影在线| 国产伦精品一区二区三区视频青涩| 91免费在线视频观看| 精品国产91亚洲一区二区三区婷婷| 国产精品色一区二区三区| 日韩精品一卡二卡三卡四卡无卡| 国产999精品久久久久久绿帽| 在线不卡一区二区| 亚洲黄色小视频| 国产 欧美在线| 日韩欧美国产精品| 亚洲成av人片www| 99精品视频免费在线观看| 久久久精品黄色| 老司机精品视频线观看86| 日本高清不卡在线观看| 中文字幕不卡三区| 国产91精品露脸国语对白| 26uuu亚洲婷婷狠狠天堂| 日韩国产一二三区| 777久久久精品| 秋霞成人午夜伦在线观看| 欧美三级在线播放| 亚洲综合图片区| 欧美三级资源在线| 亚洲bdsm女犯bdsm网站| 欧美日韩视频第一区| 一区二区国产盗摄色噜噜| 色网综合在线观看| 一级特黄大欧美久久久| 色偷偷久久一区二区三区| 亚洲美女免费视频| 欧美亚洲综合网| 午夜久久电影网| 91精品中文字幕一区二区三区| 亚洲国产精品久久艾草纯爱| 欧美日韩中文字幕一区二区| 亚洲高清免费观看高清完整版在线观看| 色婷婷久久久久swag精品| 一区二区高清在线| 欧美日韩国产免费| 日本网站在线观看一区二区三区| 欧美一卡二卡在线| 国产一区二区三区在线观看免费视频| 久久综合九色综合欧美98| 国产成人一区在线| 中文字幕日韩av资源站| 色婷婷av一区二区三区软件| 亚洲高清不卡在线| 日韩免费福利电影在线观看| 国产精品资源在线看| 国产精品免费视频网站| 色网综合在线观看| 麻豆精品久久精品色综合| 国产精品天美传媒| 日本韩国一区二区三区视频| 五月婷婷激情综合| 2023国产精品视频| 99在线精品观看| 三级亚洲高清视频| 国产色综合久久| 欧美日韩国产bt| 顶级嫩模精品视频在线看| 一区二区三区中文字幕电影 | 蜜臀va亚洲va欧美va天堂| 久久九九国产精品| 欧美影院一区二区| 狠狠色综合播放一区二区| 亚洲欧洲无码一区二区三区| 4438x成人网最大色成网站| 丰满白嫩尤物一区二区| 亚洲国产成人av| 欧美韩日一区二区三区四区| 欧美人妇做爰xxxⅹ性高电影| 国产传媒久久文化传媒| 亚洲午夜激情av| 国产欧美一区二区三区沐欲| 欧美高清精品3d| 色综合久久久久综合体 | 亚洲国产成人私人影院tom| 精品1区2区3区| 成人爱爱电影网址| 激情欧美日韩一区二区| 亚洲国产三级在线| 国产精品电影一区二区| 日韩精品影音先锋| 欧美日韩黄色影视| 97精品国产露脸对白| 国产精品资源网| 精品一区精品二区高清| 日韩黄色一级片| 亚洲夂夂婷婷色拍ww47| 中文字幕亚洲一区二区va在线| 日韩精品一区二区三区在线| 精品视频一区二区三区免费| 一本到三区不卡视频| www.欧美亚洲| 国产成人午夜精品5599| 国内精品在线播放| 精品写真视频在线观看| 另类小说图片综合网| 日本va欧美va欧美va精品| 五月婷婷色综合| 午夜精品久久久久久久蜜桃app| 亚洲综合激情网| 亚洲一二三四在线观看| 一区二区三区小说| 尤物在线观看一区| 亚洲精品久久久蜜桃| 亚洲色图第一区| 亚洲激情校园春色| 亚洲一区二区三区在线| 亚洲在线成人精品| 婷婷国产v国产偷v亚洲高清| 午夜一区二区三区在线观看| 天天做天天摸天天爽国产一区| 亚洲777理论| 久久99精品久久久久婷婷| 激情亚洲综合在线| 国产成人夜色高潮福利影视| 国产成人精品在线看| 成人免费视频网站在线观看| 91亚洲国产成人精品一区二区三| 91亚洲精品乱码久久久久久蜜桃| 91看片淫黄大片一级| 欧美日韩一区高清| 欧美r级在线观看| 国产免费观看久久| 亚洲欧美国产毛片在线| 亚洲国产欧美在线| 精品午夜一区二区三区在线观看 | 亚洲色图欧美偷拍| 亚洲电影激情视频网站| 久久精品国产精品亚洲精品| 国产精一品亚洲二区在线视频| 成人97人人超碰人人99| 欧美日韩视频在线观看一区二区三区| 日韩亚洲国产中文字幕欧美| 国产午夜精品久久久久久免费视| 亚洲欧洲无码一区二区三区| 日韩avvvv在线播放| 国产成人鲁色资源国产91色综| 在线观看av不卡| 精品国产一区二区三区不卡| 亚洲视频每日更新| 久久99国产精品久久99果冻传媒| 成人自拍视频在线| 欧美日韩精品一区二区三区四区| 久久久不卡影院| 天堂成人国产精品一区| 丰满少妇在线播放bd日韩电影| 欧美日韩在线亚洲一区蜜芽| 国产精品亲子伦对白| 天堂在线亚洲视频| 91蜜桃传媒精品久久久一区二区| 日韩精品一区二区三区视频播放 | 9191久久久久久久久久久|