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

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

?? genericobjectpool.java

?? 爬蟲
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * Copyright 1999-2004 The Apache Software Foundation. *  * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at *  *      http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.apache.commons.pool.impl;import java.util.Iterator;import java.util.NoSuchElementException;import java.util.LinkedList;import java.util.ListIterator;import java.util.Timer;import java.util.TimerTask;import org.apache.commons.pool.BaseObjectPool;import org.apache.commons.pool.ObjectPool;import org.apache.commons.pool.PoolableObjectFactory;import org.apache.commons.pool.impl.GenericKeyedObjectPool.ObjectTimestampPair;/** * A configurable {@link ObjectPool} implementation. * <p> * When coupled with the appropriate {@link PoolableObjectFactory}, * <tt>GenericObjectPool</tt> provides robust pooling functionality for * arbitrary objects. * <p> * A <tt>GenericObjectPool</tt> provides a number of configurable parameters: * <ul> *  <li> *    {@link #setMaxActive <i>maxActive</i>} controls the maximum number of objects that can *    be borrowed from the pool at one time.  When non-positive, there *    is no limit to the number of objects that may be active at one time. *    When {@link #setMaxActive <i>maxActive</i>} is exceeded, the pool is said to be exhausted. *  </li> *  <li> *    {@link #setMaxIdle <i>maxIdle</i>} controls the maximum number of objects that can *    sit idle in the pool at any time.  When negative, there *    is no limit to the number of objects that may be idle at one time. *  </li> *  <li> *    {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} specifies the *    behaviour of the {@link #borrowObject} method when the pool is exhausted: *    <ul> *    <li> *      When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} is *      {@link #WHEN_EXHAUSTED_FAIL}, {@link #borrowObject} will throw *      a {@link NoSuchElementException} *    </li> *    <li> *      When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} is *      {@link #WHEN_EXHAUSTED_GROW}, {@link #borrowObject} will create a new *      object and return it(essentially making {@link #setMaxActive <i>maxActive</i>} *      meaningless.) *    </li> *    <li> *      When {@link #setWhenExhaustedAction <i>whenExhaustedAction</i>} *      is {@link #WHEN_EXHAUSTED_BLOCK}, {@link #borrowObject} will block *      (invoke {@link Object#wait} until a new or idle object is available. *      If a positive {@link #setMaxWait <i>maxWait</i>} *      value is supplied, the {@link #borrowObject} will block for at *      most that many milliseconds, after which a {@link NoSuchElementException} *      will be thrown.  If {@link #setMaxWait <i>maxWait</i>} is non-positive, *      the {@link #borrowObject} method will block indefinitely. *    </li> *    </ul> *  </li> *  <li> *    When {@link #setTestOnBorrow <i>testOnBorrow</i>} is set, the pool will *    attempt to validate each object before it is returned from the *    {@link #borrowObject} method. (Using the provided factory's *    {@link PoolableObjectFactory#validateObject} method.)  Objects that fail *    to validate will be dropped from the pool, and a different object will *    be borrowed. *  </li> *  <li> *    When {@link #setTestOnReturn <i>testOnReturn</i>} is set, the pool will *    attempt to validate each object before it is returned to the pool in the *    {@link #returnObject} method. (Using the provided factory's *    {@link PoolableObjectFactory#validateObject} *    method.)  Objects that fail to validate will be dropped from the pool. *  </li> * </ul> * <p> * Optionally, one may configure the pool to examine and possibly evict objects as they * sit idle in the pool.  This is performed by an "idle object eviction" thread, which * runs asychronously.  The idle object eviction thread may be configured using the * following attributes: * <ul> *  <li> *   {@link #setTimeBetweenEvictionRunsMillis <i>timeBetweenEvictionRunsMillis</i>} *   indicates how long the eviction thread should sleep before "runs" of examining *   idle objects.  When non-positive, no eviction thread will be launched. *  </li> *  <li> *   {@link #setMinEvictableIdleTimeMillis <i>minEvictableIdleTimeMillis</i>} *   specifies the minimum amount of time that an object may sit idle in the pool *   before it is eligable for eviction due to idle time.  When non-positive, no object *   will be dropped from the pool due to idle time alone. *  </li> *  <li> *   {@link #setTestWhileIdle <i>testWhileIdle</i>} indicates whether or not idle *   objects should be validated using the factory's *   {@link PoolableObjectFactory#validateObject} method.  Objects *   that fail to validate will be dropped from the pool. *  </li> * </ul> * <p> * GenericObjectPool is not usable without a {@link PoolableObjectFactory}.  A * non-<code>null</code> factory must be provided either as a constructor argument * or via a call to {@link #setFactory} before the pool is used. * * @see GenericKeyedObjectPool * @author Rodney Waldhoff * @author Dirk Verbeeck * @version $Revision: 1.2 $ $Date: 2006/05/16 01:31:42 $ */public class GenericObjectPool extends BaseObjectPool implements ObjectPool {    //--- public constants -------------------------------------------    /**     * A "when exhausted action" type indicating that when the pool is     * exhausted (i.e., the maximum number of active objects has     * been reached), the {@link #borrowObject}     * method should fail, throwing a {@link NoSuchElementException}.     * @see #WHEN_EXHAUSTED_BLOCK     * @see #WHEN_EXHAUSTED_GROW     * @see #setWhenExhaustedAction     */    public static final byte WHEN_EXHAUSTED_FAIL   = 0;    /**     * A "when exhausted action" type indicating that when the pool     * is exhausted (i.e., the maximum number     * of active objects has been reached), the {@link #borrowObject}     * method should block until a new object is available, or the     * {@link #getMaxWait maximum wait time} has been reached.     * @see #WHEN_EXHAUSTED_FAIL     * @see #WHEN_EXHAUSTED_GROW     * @see #setMaxWait     * @see #getMaxWait     * @see #setWhenExhaustedAction     */    public static final byte WHEN_EXHAUSTED_BLOCK  = 1;    /**     * A "when exhausted action" type indicating that when the pool is     * exhausted (i.e., the maximum number     * of active objects has been reached), the {@link #borrowObject}     * method should simply create a new object anyway.     * @see #WHEN_EXHAUSTED_FAIL     * @see #WHEN_EXHAUSTED_GROW     * @see #setWhenExhaustedAction     */    public static final byte WHEN_EXHAUSTED_GROW   = 2;    /**     * The default cap on the number of "sleeping" instances in the pool.     * @see #getMaxIdle     * @see #setMaxIdle     */    public static final int DEFAULT_MAX_IDLE  = 8;    /**     * The default minimum number of "sleeping" instances in the pool     * before before the evictor thread (if active) spawns new objects.     * @see #getMinIdle     * @see #setMinIdle     */    public static final int DEFAULT_MIN_IDLE = 0;    /**     * The default cap on the total number of active instances from the pool.     * @see #getMaxActive     */    public static final int DEFAULT_MAX_ACTIVE  = 8;    /**     * The default "when exhausted action" for the pool.     * @see #WHEN_EXHAUSTED_BLOCK     * @see #WHEN_EXHAUSTED_FAIL     * @see #WHEN_EXHAUSTED_GROW     * @see #setWhenExhaustedAction     */    public static final byte DEFAULT_WHEN_EXHAUSTED_ACTION = WHEN_EXHAUSTED_BLOCK;    /**     * The default maximum amount of time (in millis) the     * {@link #borrowObject} method should block before throwing     * an exception when the pool is exhausted and the     * {@link #getWhenExhaustedAction "when exhausted" action} is     * {@link #WHEN_EXHAUSTED_BLOCK}.     * @see #getMaxWait     * @see #setMaxWait     */    public static final long DEFAULT_MAX_WAIT = -1L;    /**     * The default "test on borrow" value.     * @see #getTestOnBorrow     * @see #setTestOnBorrow     */    public static final boolean DEFAULT_TEST_ON_BORROW = false;    /**     * The default "test on return" value.     * @see #getTestOnReturn     * @see #setTestOnReturn     */    public static final boolean DEFAULT_TEST_ON_RETURN = false;    /**     * The default "test while idle" value.     * @see #getTestWhileIdle     * @see #setTestWhileIdle     * @see #getTimeBetweenEvictionRunsMillis     * @see #setTimeBetweenEvictionRunsMillis     */    public static final boolean DEFAULT_TEST_WHILE_IDLE = false;    /**     * The default "time between eviction runs" value.     * @see #getTimeBetweenEvictionRunsMillis     * @see #setTimeBetweenEvictionRunsMillis     */    public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = -1L;    /**     * The default number of objects to examine per run in the     * idle object evictor.     * @see #getNumTestsPerEvictionRun     * @see #setNumTestsPerEvictionRun     * @see #getTimeBetweenEvictionRunsMillis     * @see #setTimeBetweenEvictionRunsMillis     */    public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = 3;    /**     * The default value for {@link #getMinEvictableIdleTimeMillis}.     * @see #getMinEvictableIdleTimeMillis     * @see #setMinEvictableIdleTimeMillis     */    public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS = 1000L * 60L * 30L;    /**     * The default value for {@link #getSoftMinEvictableIdleTimeMillis}.     * @see #getSoftMinEvictableIdleTimeMillis     * @see #setSoftMinEvictableIdleTimeMillis     */    public static final long DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS = -1;    //--- package constants -------------------------------------------    /**     * Idle object evition Timer. Shared between all {@link GenericObjectPool}s and {@link GenericKeyedObjectPool} s.     */    static final Timer EVICTION_TIMER = new Timer(true);    //--- constructors -----------------------------------------------    /**     * Create a new <tt>GenericObjectPool</tt>.     */    public GenericObjectPool() {        this(null,DEFAULT_MAX_ACTIVE,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_IDLE,DEFAULT_MIN_IDLE,DEFAULT_TEST_ON_BORROW,DEFAULT_TEST_ON_RETURN,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE);    }    /**     * Create a new <tt>GenericObjectPool</tt> using the specified values.     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects     */    public GenericObjectPool(PoolableObjectFactory factory) {        this(factory,DEFAULT_MAX_ACTIVE,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_IDLE,DEFAULT_MIN_IDLE,DEFAULT_TEST_ON_BORROW,DEFAULT_TEST_ON_RETURN,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE);    }    /**     * Create a new <tt>GenericObjectPool</tt> using the specified values.     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects     * @param config a non-<tt>null</tt> {@link GenericObjectPool.Config} describing my configuration     */    public GenericObjectPool(PoolableObjectFactory factory, GenericObjectPool.Config config) {        this(factory,config.maxActive,config.whenExhaustedAction,config.maxWait,config.maxIdle,config.minIdle,config.testOnBorrow,config.testOnReturn,config.timeBetweenEvictionRunsMillis,config.numTestsPerEvictionRun,config.minEvictableIdleTimeMillis,config.testWhileIdle);    }    /**     * Create a new <tt>GenericObjectPool</tt> using the specified values.     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects     * @param maxActive the maximum number of objects that can be borrowed from me at one time (see {@link #setMaxActive})     */    public GenericObjectPool(PoolableObjectFactory factory, int maxActive) {        this(factory,maxActive,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_IDLE,DEFAULT_MIN_IDLE,DEFAULT_TEST_ON_BORROW,DEFAULT_TEST_ON_RETURN,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE);    }    /**     * Create a new <tt>GenericObjectPool</tt> using the specified values.     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects     * @param maxActive the maximum number of objects that can be borrowed from me at one time (see {@link #setMaxActive})     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #getWhenExhaustedAction})     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #getMaxWait})     */    public GenericObjectPool(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait) {        this(factory,maxActive,whenExhaustedAction,maxWait,DEFAULT_MAX_IDLE,DEFAULT_MIN_IDLE,DEFAULT_TEST_ON_BORROW,DEFAULT_TEST_ON_RETURN,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE);    }    /**     * Create a new <tt>GenericObjectPool</tt> using the specified values.     * @param factory the (possibly <tt>null</tt>)PoolableObjectFactory to use to create, validate and destroy objects     * @param maxActive the maximum number of objects that can be borrowed from me at one time (see {@link #setMaxActive})     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #getWhenExhaustedAction})     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and <i>whenExhaustedAction</i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #getMaxWait})     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject} method (see {@link #getTestOnBorrow})     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject} method (see {@link #getTestOnReturn})     */    public GenericObjectPool(PoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, boolean testOnBorrow, boolean testOnReturn) {        this(factory,maxActive,whenExhaustedAction,maxWait,DEFAULT_MAX_IDLE,DEFAULT_MIN_IDLE,testOnBorrow,testOnReturn,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人性色生活片免费看爆迷你毛片| 成人午夜视频在线观看| 国产乱码精品1区2区3区| 91免费小视频| 久久亚洲免费视频| 亚洲成人高清在线| 99久久伊人久久99| 欧美不卡激情三级在线观看| 一区二区三区在线观看视频| 国产在线播精品第三| 欧美精品乱码久久久久久按摩| 中文字幕不卡的av| 国产一区二区三区高清播放| 欧美日韩国产综合视频在线观看| 国产精品欧美久久久久无广告 | 日本道精品一区二区三区| 日韩精品一区二区三区在线 | 欧美一二区视频| 亚洲欧美日韩国产综合在线| 国产乱码精品一区二区三区av | 国产精品麻豆一区二区| 国产一区不卡视频| 日韩精品一区在线| 日本美女视频一区二区| 欧美日韩aaaaa| 亚洲成在人线在线播放| 欧美亚洲动漫另类| 亚洲一区在线观看视频| 一本色道综合亚洲| 亚洲欧美色图小说| 欧美性猛交xxxxxxxx| 亚洲免费观看在线视频| 91免费国产在线观看| 亚洲私人影院在线观看| 91美女蜜桃在线| 亚洲日本在线观看| 欧美专区日韩专区| 亚洲大型综合色站| 欧美一区二区三区视频在线| 日韩av一区二| 精品久久国产老人久久综合| 国产一区二区三区香蕉| 欧美激情一区二区三区| 96av麻豆蜜桃一区二区| 亚洲一线二线三线久久久| 欧美日韩国产123区| 麻豆国产欧美日韩综合精品二区 | 日韩va欧美va亚洲va久久| 91精品国产欧美一区二区成人| 日本系列欧美系列| 精品欧美一区二区三区精品久久 | 日本va欧美va欧美va精品| 777久久久精品| 国产麻豆视频一区二区| 国产精品理论片在线观看| 91老师国产黑色丝袜在线| 午夜视频久久久久久| 欧美v亚洲v综合ⅴ国产v| 黄页网站大全一区二区| 国产一区久久久| 日本久久一区二区三区| 中文字幕不卡一区| 粉嫩av亚洲一区二区图片| 日韩美女一区二区三区四区| 亚洲高清视频在线| 色综合色综合色综合色综合色综合| 日韩精品中文字幕一区二区三区| 免费久久99精品国产| 国产精品一级黄| 欧美日韩1234| 国产精品一区一区三区| 亚洲男人的天堂一区二区| 欧美一卡二卡在线观看| 国产精品一区二区在线播放| 欧美精品高清视频| 亚洲狠狠爱一区二区三区| 奇米精品一区二区三区在线观看| 91毛片在线观看| 一区二区三区不卡视频| 日韩一级精品视频在线观看| 成人国产免费视频| 日本 国产 欧美色综合| 国产精品久久夜| 精品国免费一区二区三区| 色婷婷久久99综合精品jk白丝| 捆绑调教一区二区三区| 亚洲精品五月天| 国产午夜精品一区二区三区视频 | 一区二区三区精品在线观看| 56国语精品自产拍在线观看| 粉嫩一区二区三区在线看| 五月天网站亚洲| 亚洲在线成人精品| 成人美女视频在线观看| 26uuuu精品一区二区| 99久久伊人精品| 国产麻豆精品在线| 蜜臀久久久99精品久久久久久| 一区二区三区在线播| 欧美国产欧美综合| 久久久精品日韩欧美| 日韩欧美专区在线| 欧美人狂配大交3d怪物一区| 色综合久久天天| 99热精品一区二区| 成人动漫av在线| 国产经典欧美精品| 精品亚洲成av人在线观看| 丝袜亚洲另类欧美| 午夜激情综合网| 亚洲成av人片在www色猫咪| 亚洲自拍偷拍九九九| 一区二区三区不卡在线观看| 成人免费小视频| 亚洲免费视频成人| 亚洲黄色性网站| 亚洲免费观看高清完整版在线观看 | 欧美午夜电影在线播放| 国产91丝袜在线播放| 国产乱淫av一区二区三区| 黄色精品一二区| 国产一区欧美日韩| 国产精品456| 粉嫩13p一区二区三区| 成人三级在线视频| 91片在线免费观看| 欧洲精品一区二区三区在线观看| 91麻豆国产福利精品| 欧美亚洲动漫精品| 91精品欧美综合在线观看最新| 日韩丝袜美女视频| 久久久精品2019中文字幕之3| 国产午夜精品一区二区| 国产精品女同互慰在线看| 国产精品成人午夜| 亚洲成年人影院| 蜜臀久久99精品久久久久久9 | 欧美久久一二区| 精品乱码亚洲一区二区不卡| 久久老女人爱爱| 亚洲欧洲99久久| 亚洲午夜三级在线| 精品亚洲国内自在自线福利| 成人听书哪个软件好| 欧美三级一区二区| 精品欧美一区二区在线观看| 国产精品麻豆99久久久久久| 亚洲一区在线视频| 精品亚洲porn| 91首页免费视频| 日韩亚洲欧美一区| 国产精品久久久久aaaa| 亚洲444eee在线观看| 国产精品主播直播| 欧洲日韩一区二区三区| 精品免费视频.| 有坂深雪av一区二区精品| 老鸭窝一区二区久久精品| 99在线精品免费| 欧美v国产在线一区二区三区| 精品无人码麻豆乱码1区2区 | 日韩国产精品大片| 国产精品主播直播| 欧美日韩国产一二三| 久久久久久久久久美女| 性久久久久久久久| av电影天堂一区二区在线观看| 欧美日韩成人综合| 中文字幕亚洲在| 国产尤物一区二区| 欧美巨大另类极品videosbest | 国产成人aaa| 日韩精品一区二区三区在线播放 | 国产肉丝袜一区二区| 亚洲免费毛片网站| 不卡的电视剧免费网站有什么| 日韩欧美aaaaaa| 亚洲成人综合在线| 成人激情免费视频| 大陆成人av片| 日韩一区二区三区观看| 亚洲免费高清视频在线| 国产高清在线精品| 欧美成人免费网站| 亚洲狠狠爱一区二区三区| 99久久99久久精品国产片果冻| 久久免费看少妇高潮| 日产欧产美韩系列久久99| 欧美视频中文字幕| 依依成人综合视频| 91丨porny丨中文| 亚洲欧洲在线观看av| 国产伦精品一区二区三区免费迷| 欧美一激情一区二区三区| 亚洲成人动漫精品| 欧美日韩精品福利| 亚洲成人精品一区| 9191成人精品久久| 日韩黄色小视频| 日韩一二三四区|