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

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

?? genericobjectpool.java

?? 一個基于lucene&heritrix的搜索引擎
?? 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一区二区三区免费野_久草精品视频
婷婷丁香久久五月婷婷| 日韩精品综合一本久道在线视频| 国产精品一区不卡| 欧美日韩日日摸| 亚洲欧美福利一区二区| 国产精品综合av一区二区国产馆| 日韩一级视频免费观看在线| 91精品国产一区二区人妖| 精品成a人在线观看| 久久精品99国产国产精| 26uuu精品一区二区在线观看| 精品少妇一区二区三区日产乱码 | 福利91精品一区二区三区| 欧美zozozo| 成人影视亚洲图片在线| 欧美国产欧美亚州国产日韩mv天天看完整| 久久99久久精品| 色综合天天综合网国产成人综合天| 91在线国内视频| 亚洲免费资源在线播放| 欧美疯狂做受xxxx富婆| 蜜臀99久久精品久久久久久软件| 欧美成人女星排行榜| 成人性生交大片免费看在线播放 | 亚洲理论在线观看| 狠狠色丁香婷婷综合久久片| 91精品国产综合久久久久久漫画| 奇米精品一区二区三区四区| 精品久久久久香蕉网| 久久91精品久久久久久秒播| 欧美tickling挠脚心丨vk| 国产a久久麻豆| 蜜臀av性久久久久蜜臀aⅴ四虎| 日韩免费高清av| 777午夜精品免费视频| 午夜精品一区二区三区免费视频| 欧美精品乱码久久久久久按摩| 奇米777欧美一区二区| 国产精品久久国产精麻豆99网站| 欧美三级一区二区| 91视频在线观看| 日日夜夜精品免费视频| 337p粉嫩大胆色噜噜噜噜亚洲| 91视频免费观看| 成人性色生活片免费看爆迷你毛片| 蓝色福利精品导航| 黄页网站大全一区二区| 精品国产不卡一区二区三区| 91在线高清观看| 国产成人三级在线观看| 国内成+人亚洲+欧美+综合在线| 亚洲成a人片综合在线| 日韩一级片网址| 色综合天天天天做夜夜夜夜做| 国产精品羞羞答答xxdd| 日产国产高清一区二区三区| 一区二区三区日本| 久久综合精品国产一区二区三区| 日本精品一区二区三区高清| 亚洲一卡二卡三卡四卡无卡久久 | 91麻豆福利精品推荐| 色悠悠亚洲一区二区| 欧美老年两性高潮| 精品一区二区三区视频在线观看| 美女视频黄频大全不卡视频在线播放| 国产成人精品影院| 久久日韩粉嫩一区二区三区| 日本午夜一本久久久综合| 欧美亚洲一区三区| 一区二区三区在线免费| 91女厕偷拍女厕偷拍高清| 中文字幕在线不卡视频| 高清不卡一二三区| 中文文精品字幕一区二区| 国产乱人伦偷精品视频不卡 | 国产盗摄视频一区二区三区| 久久久精品影视| 92精品国产成人观看免费| 国产精品成人免费精品自在线观看| 成人美女视频在线看| 亚洲欧美日韩国产手机在线| 色婷婷国产精品| 日韩av在线播放中文字幕| 欧美精品一区二区三区蜜臀| www.久久精品| 国产黑丝在线一区二区三区| 亚洲日本成人在线观看| 91精品免费观看| 99久久99久久精品免费观看 | 亚洲欧美另类图片小说| 欧美精品三级在线观看| heyzo一本久久综合| 五月天精品一区二区三区| 国产欧美日韩在线看| 欧美另类高清zo欧美| fc2成人免费人成在线观看播放| 亚洲国产日韩av| 亚洲天堂久久久久久久| 久久免费午夜影院| 91精品国产综合久久久久久| 99精品桃花视频在线观看| 毛片av一区二区| 亚洲chinese男男1069| 亚洲精品免费一二三区| 亚洲精品在线观看网站| 欧美性videosxxxxx| 精品亚洲成av人在线观看| 亚洲色图在线视频| 精品久久国产字幕高潮| 日本韩国欧美三级| 成人性生交大合| 国产主播一区二区三区| 三级欧美在线一区| 一区二区三区中文字幕电影| 国产精品网曝门| 久久久美女艺术照精彩视频福利播放| 7777精品伊人久久久大香线蕉完整版 | 久久精品免费在线观看| 日韩一级片在线观看| 欧美一级xxx| 日韩亚洲欧美一区| 日韩女优av电影在线观看| 6080yy午夜一二三区久久| 色综合夜色一区| 欧美影院一区二区三区| 91久久香蕉国产日韩欧美9色| 风间由美中文字幕在线看视频国产欧美| 久久国产人妖系列| 精品一区二区av| 成人综合婷婷国产精品久久免费| 精东粉嫩av免费一区二区三区| 久久成人免费电影| 高清国产一区二区三区| 成人sese在线| 精品视频资源站| 日韩欧美中文字幕一区| 国产色爱av资源综合区| 一区二区视频在线看| 日本怡春院一区二区| 成人精品亚洲人成在线| 欧美日韩免费电影| 国产精品你懂的在线| 亚洲国产精品人人做人人爽| 精一区二区三区| 欧美日韩中文字幕一区| 亚洲国产高清在线观看视频| 亚洲国产一二三| 丁香激情综合国产| 欧美一级艳片视频免费观看| 亚洲欧洲日产国码二区| 麻豆成人免费电影| 日本道色综合久久| 国产精品人成在线观看免费| 男女激情视频一区| 欧美日韩精品三区| 亚洲综合区在线| 972aa.com艺术欧美| 久久亚洲精品国产精品紫薇| 免费观看在线综合色| 欧美日韩精品欧美日韩精品一| 国产三级一区二区| 国产一区视频网站| 久久精品一级爱片| 国产精品99久久不卡二区| 日韩午夜中文字幕| 国产麻豆视频一区| 久久久精品免费免费| 懂色av中文字幕一区二区三区| 久久久午夜精品| 欧美日韩aaaaa| 国产精品亚洲专一区二区三区| 国产精品电影院| 7777精品伊人久久久大香线蕉的 | 久久精品一级爱片| jiyouzz国产精品久久| 亚洲一区二区四区蜜桃| www国产亚洲精品久久麻豆| 成人涩涩免费视频| 蜜桃av噜噜一区二区三区小说| 久久免费国产精品| 日韩一级片网站| 欧美精品自拍偷拍动漫精品| 国产精品18久久久久久久网站| 亚洲18女电影在线观看| 中文字幕不卡在线观看| 日韩欧美一区二区视频| 欧美日韩在线直播| 成人黄色大片在线观看| 国产在线日韩欧美| 免费精品视频最新在线| 亚洲va天堂va国产va久| 亚洲精品第1页| 亚洲va天堂va国产va久| 天堂va蜜桃一区二区三区 | 91精品国产综合久久蜜臀| 色av成人天堂桃色av| 色哟哟亚洲精品| 欧美性欧美巨大黑白大战| 欧美色偷偷大香| 91精品国产高清一区二区三区蜜臀 |