亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩免费观看高清完整版在线观看| 91社区在线播放| 国产精品国产三级国产aⅴ中文 | 欧美色爱综合网| 久久99国产精品免费网站| 亚洲人123区| 精品久久人人做人人爰| 欧洲精品在线观看| 国产精品一线二线三线精华| 夜色激情一区二区| 国产精品毛片大码女人| 日韩免费一区二区三区在线播放| 色呦呦国产精品| 国产成人啪午夜精品网站男同| 天天综合天天综合色| 亚洲欧洲av在线| 久久久久国产精品麻豆ai换脸| 欧美日韩久久久久久| 99久久久免费精品国产一区二区| 久久97超碰色| 日本在线播放一区二区三区| 亚洲理论在线观看| 中文在线一区二区| 国产亚洲精品aa| 精品国产免费视频| 91精品国产综合久久婷婷香蕉| 日本黄色一区二区| 精品国产网站在线观看| 欧美日韩aaaaa| 欧美日韩中文精品| 日本久久电影网| 一本久久综合亚洲鲁鲁五月天| 成人黄色一级视频| 国产高清亚洲一区| 国产精品99久久久| 国产精品一区三区| 国产成人啪免费观看软件| 国产乱码精品一品二品| 国产一区二区在线看| 国精产品一区一区三区mba桃花| 美女视频黄频大全不卡视频在线播放| 亚洲成av人片| 日韩精品一二区| 日产国产高清一区二区三区| 婷婷成人激情在线网| 亚洲成人黄色小说| 亚洲第一综合色| 天堂成人国产精品一区| 日韩电影一区二区三区| 麻豆成人久久精品二区三区小说| 久色婷婷小香蕉久久| 精品一区二区精品| 国产成人aaa| jlzzjlzz亚洲日本少妇| 色美美综合视频| 欧美视频中文一区二区三区在线观看 | 亚洲三级理论片| 亚洲免费伊人电影| 香港成人在线视频| 久久精品国产99久久6| 国产一区二区免费看| 粗大黑人巨茎大战欧美成人| 91在线播放网址| 欧美四级电影网| 精品美女在线观看| 亚洲国产精品av| 亚洲乱码国产乱码精品精的特点 | 一区二区三区.www| 视频一区在线播放| 国产一区视频在线看| 99久久婷婷国产综合精品| 欧美影院一区二区三区| 日韩欧美三级在线| 中文字幕av在线一区二区三区| 亚洲精品日韩一| 美女任你摸久久| www.欧美日韩国产在线| 欧美日韩久久久久久| 久久视频一区二区| 一区二区高清免费观看影视大全 | 成人在线综合网站| 欧美亚洲禁片免费| 久久久久久久久久久黄色| 亚洲精品免费一二三区| 精品在线免费观看| 色哟哟精品一区| www精品美女久久久tv| 夜夜嗨av一区二区三区中文字幕| 欧美剧在线免费观看网站| 欧美日韩国产一二三| 国产色91在线| 日本一区二区三区四区在线视频| 国产欧美日韩不卡免费| 亚洲综合在线第一页| 免费一级片91| 91免费版在线| 精品久久久久99| 亚洲伊人伊色伊影伊综合网| 国产美女在线精品| 欧美日韩一区三区| 亚洲国产高清在线| 蜜桃视频在线观看一区二区| 99久久99久久精品免费看蜜桃| 日韩一区二区三区高清免费看看| 亚洲色图清纯唯美| 国产精品综合网| 51精品秘密在线观看| 亚洲视频综合在线| 国产精品123区| 日韩亚洲欧美中文三级| 亚洲已满18点击进入久久| 成人一级黄色片| 精品久久久久久久人人人人传媒| 亚洲综合av网| 92精品国产成人观看免费| 久久久久高清精品| 精品一区二区精品| 日韩视频一区二区| 丝瓜av网站精品一区二区| 在线中文字幕一区| 欧美伊人久久久久久久久影院| 日韩一级片在线观看| 亚洲成人精品一区二区| 91视频在线观看| 国产精品视频在线看| 国产乱码一区二区三区| 精品久久久久久久久久久院品网 | 自拍偷拍亚洲激情| 丁香婷婷综合五月| 久久在线免费观看| 精品一区二区免费在线观看| 日韩欧美一二区| 免费成人美女在线观看.| 欧美高清www午色夜在线视频| 亚洲黄色av一区| 在线影视一区二区三区| 一个色综合网站| 欧美影院一区二区三区| 亚洲一二三专区| 欧美日韩中文字幕一区| 亚洲h精品动漫在线观看| 欧美老年两性高潮| 日韩高清一区在线| 欧美刺激午夜性久久久久久久 | 97久久精品人人爽人人爽蜜臀| 国产精品日产欧美久久久久| 大胆欧美人体老妇| 国产精品色哟哟网站| 亚洲综合无码一区二区| av中文字幕一区| 亚洲欧美自拍偷拍| 99久久综合狠狠综合久久| 日韩美女精品在线| 日本韩国一区二区| 午夜影视日本亚洲欧洲精品| 欧美日韩不卡一区| 蜜臀av性久久久久蜜臀av麻豆| 日韩视频在线一区二区| 黑人巨大精品欧美黑白配亚洲| 久久这里只有精品6| 成a人片国产精品| 一区二区三区精品视频| 亚洲乱码国产乱码精品精可以看 | 不卡一区二区中文字幕| 亚洲免费在线观看| 欧美另类高清zo欧美| 久久国产夜色精品鲁鲁99| 中文子幕无线码一区tr| 欧美系列日韩一区| 久久国产精品区| 最近日韩中文字幕| 欧美精品一二三| 国产成人精品一区二区三区四区 | 国产精品久久久一本精品| 在线精品视频小说1| 美女被吸乳得到大胸91| 国产精品伦理一区二区| 欧美日韩视频一区二区| 国产一区二区精品久久| 亚洲视频在线一区| 日韩精品最新网址| 精品乱人伦一区二区三区| 久久成人精品无人区| 国产三级久久久| 欧美在线不卡一区| 看片的网站亚洲| 1区2区3区欧美| 666欧美在线视频| av在线播放不卡| 美女一区二区视频| 亚洲欧洲精品一区二区三区不卡| 欧美老女人第四色| 成人免费电影视频| 麻豆精品视频在线观看| 日韩毛片视频在线看| www激情久久| 91麻豆精品91久久久久久清纯| 波多野结衣在线一区| 狂野欧美性猛交blacked| 一区二区欧美精品|