Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AF1B5200D2A for ; Sat, 28 Oct 2017 20:29:28 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AE1B8160BDC; Sat, 28 Oct 2017 18:29:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 525CF160C08 for ; Sat, 28 Oct 2017 20:29:26 +0200 (CEST) Received: (qmail 82477 invoked by uid 500); 28 Oct 2017 18:29:25 -0000 Mailing-List: contact notifications-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list notifications@commons.apache.org Received: (qmail 82377 invoked by uid 99); 28 Oct 2017 18:29:25 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Oct 2017 18:29:25 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 0DAF93A167B for ; Sat, 28 Oct 2017 18:29:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1020166 [33/44] - in /websites/production/commons/content/proper/commons-pool: ./ api-2.4.3/ api-2.4.3/org/ api-2.4.3/org/apache/ api-2.4.3/org/apache/commons/ api-2.4.3/org/apache/commons/pool2/ api-2.4.3/org/apache/commons/pool2/class-us... Date: Sat, 28 Oct 2017 18:29:13 -0000 To: notifications@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20171028182919.0DAF93A167B@svn01-us-west.apache.org> archived-at: Sat, 28 Oct 2017 18:29:28 -0000 Added: websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/BaseObjectPoolConfig.html ============================================================================== --- websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/BaseObjectPoolConfig.html (added) +++ websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/BaseObjectPoolConfig.html Sat Oct 28 18:29:09 2017 @@ -0,0 +1,790 @@ + + + +Source code + + + +
+
001/*
+002 * Licensed to the Apache Software Foundation (ASF) under one or more
+003 * contributor license agreements.  See the NOTICE file distributed with
+004 * this work for additional information regarding copyright ownership.
+005 * The ASF licenses this file to You under the Apache License, Version 2.0
+006 * (the "License"); you may not use this file except in compliance with
+007 * the License.  You may obtain a copy of the License at
+008 *
+009 *      http://www.apache.org/licenses/LICENSE-2.0
+010 *
+011 * Unless required by applicable law or agreed to in writing, software
+012 * distributed under the License is distributed on an "AS IS" BASIS,
+013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+014 * See the License for the specific language governing permissions and
+015 * limitations under the License.
+016 */
+017package org.apache.commons.pool2.impl;
+018
+019import org.apache.commons.pool2.BaseObject;
+020
+021/**
+022 * Provides the implementation for the common attributes shared by the
+023 * sub-classes. New instances of this class will be created using the defaults
+024 * defined by the public constants.
+025 * <p>
+026 * This class is not thread-safe.
+027 *
+028 * @since 2.0
+029 */
+030public abstract class BaseObjectPoolConfig extends BaseObject implements Cloneable {
+031
+032    /**
+033     * The default value for the {@code lifo} configuration attribute.
+034     * @see GenericObjectPool#getLifo()
+035     * @see GenericKeyedObjectPool#getLifo()
+036     */
+037    public static final boolean DEFAULT_LIFO = true;
+038
+039    /**
+040     * The default value for the {@code fairness} configuration attribute.
+041     * @see GenericObjectPool#getFairness()
+042     * @see GenericKeyedObjectPool#getFairness()
+043     */
+044    public static final boolean DEFAULT_FAIRNESS = false;
+045
+046    /**
+047     * The default value for the {@code maxWait} configuration attribute.
+048     * @see GenericObjectPool#getMaxWaitMillis()
+049     * @see GenericKeyedObjectPool#getMaxWaitMillis()
+050     */
+051    public static final long DEFAULT_MAX_WAIT_MILLIS = -1L;
+052
+053    /**
+054     * The default value for the {@code minEvictableIdleTimeMillis}
+055     * configuration attribute.
+056     * @see GenericObjectPool#getMinEvictableIdleTimeMillis()
+057     * @see GenericKeyedObjectPool#getMinEvictableIdleTimeMillis()
+058     */
+059    public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS =
+060            1000L * 60L * 30L;
+061
+062    /**
+063     * The default value for the {@code softMinEvictableIdleTimeMillis}
+064     * configuration attribute.
+065     * @see GenericObjectPool#getSoftMinEvictableIdleTimeMillis()
+066     * @see GenericKeyedObjectPool#getSoftMinEvictableIdleTimeMillis()
+067     */
+068    public static final long DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS = -1;
+069
+070    /**
+071     * The default value for {@code evictorShutdownTimeoutMillis} configuration
+072     * attribute.
+073     * @see GenericObjectPool#getEvictorShutdownTimeoutMillis()
+074     * @see GenericKeyedObjectPool#getEvictorShutdownTimeoutMillis()
+075     */
+076    public static final long DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS =
+077            10L * 1000L;
+078
+079    /**
+080     * The default value for the {@code numTestsPerEvictionRun} configuration
+081     * attribute.
+082     * @see GenericObjectPool#getNumTestsPerEvictionRun()
+083     * @see GenericKeyedObjectPool#getNumTestsPerEvictionRun()
+084     */
+085    public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = 3;
+086
+087    /**
+088     * The default value for the {@code testOnCreate} configuration attribute.
+089     * @see GenericObjectPool#getTestOnCreate()
+090     * @see GenericKeyedObjectPool#getTestOnCreate()
+091     *
+092     * @since 2.2
+093     */
+094    public static final boolean DEFAULT_TEST_ON_CREATE = false;
+095
+096    /**
+097     * The default value for the {@code testOnBorrow} configuration attribute.
+098     * @see GenericObjectPool#getTestOnBorrow()
+099     * @see GenericKeyedObjectPool#getTestOnBorrow()
+100     */
+101    public static final boolean DEFAULT_TEST_ON_BORROW = false;
+102
+103    /**
+104     * The default value for the {@code testOnReturn} configuration attribute.
+105     * @see GenericObjectPool#getTestOnReturn()
+106     * @see GenericKeyedObjectPool#getTestOnReturn()
+107     */
+108    public static final boolean DEFAULT_TEST_ON_RETURN = false;
+109
+110    /**
+111     * The default value for the {@code testWhileIdle} configuration attribute.
+112     * @see GenericObjectPool#getTestWhileIdle()
+113     * @see GenericKeyedObjectPool#getTestWhileIdle()
+114     */
+115    public static final boolean DEFAULT_TEST_WHILE_IDLE = false;
+116
+117    /**
+118     * The default value for the {@code timeBetweenEvictionRunsMillis}
+119     * configuration attribute.
+120     * @see GenericObjectPool#getTimeBetweenEvictionRunsMillis()
+121     * @see GenericKeyedObjectPool#getTimeBetweenEvictionRunsMillis()
+122     */
+123    public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = -1L;
+124
+125    /**
+126     * The default value for the {@code blockWhenExhausted} configuration
+127     * attribute.
+128     * @see GenericObjectPool#getBlockWhenExhausted()
+129     * @see GenericKeyedObjectPool#getBlockWhenExhausted()
+130     */
+131    public static final boolean DEFAULT_BLOCK_WHEN_EXHAUSTED = true;
+132
+133    /**
+134     * The default value for enabling JMX for pools created with a configuration
+135     * instance.
+136     */
+137    public static final boolean DEFAULT_JMX_ENABLE = true;
+138
+139    /**
+140     * The default value for the prefix used to name JMX enabled pools created
+141     * with a configuration instance.
+142     * @see GenericObjectPool#getJmxName()
+143     * @see GenericKeyedObjectPool#getJmxName()
+144     */
+145    public static final String DEFAULT_JMX_NAME_PREFIX = "pool";
+146
+147    /**
+148     * The default value for the base name to use to name JMX enabled pools
+149     * created with a configuration instance. The default is <code>null</code>
+150     * which means the pool will provide the base name to use.
+151     * @see GenericObjectPool#getJmxName()
+152     * @see GenericKeyedObjectPool#getJmxName()
+153     */
+154    public static final String DEFAULT_JMX_NAME_BASE = null;
+155
+156    /**
+157     * The default value for the {@code evictionPolicyClassName} configuration
+158     * attribute.
+159     * @see GenericObjectPool#getEvictionPolicyClassName()
+160     * @see GenericKeyedObjectPool#getEvictionPolicyClassName()
+161     */
+162    public static final String DEFAULT_EVICTION_POLICY_CLASS_NAME =
+163            "org.apache.commons.pool2.impl.DefaultEvictionPolicy";
+164
+165
+166    private boolean lifo = DEFAULT_LIFO;
+167
+168    private boolean fairness = DEFAULT_FAIRNESS;
+169
+170    private long maxWaitMillis = DEFAULT_MAX_WAIT_MILLIS;
+171
+172    private long minEvictableIdleTimeMillis =
+173            DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
+174
+175    private long evictorShutdownTimeoutMillis =
+176            DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS;
+177
+178    private long softMinEvictableIdleTimeMillis =
+179            DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
+180
+181    private int numTestsPerEvictionRun =
+182            DEFAULT_NUM_TESTS_PER_EVICTION_RUN;
+183
+184    private String evictionPolicyClassName = DEFAULT_EVICTION_POLICY_CLASS_NAME;
+185
+186    private boolean testOnCreate = DEFAULT_TEST_ON_CREATE;
+187
+188    private boolean testOnBorrow = DEFAULT_TEST_ON_BORROW;
+189
+190    private boolean testOnReturn = DEFAULT_TEST_ON_RETURN;
+191
+192    private boolean testWhileIdle = DEFAULT_TEST_WHILE_IDLE;
+193
+194    private long timeBetweenEvictionRunsMillis =
+195            DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS;
+196
+197    private boolean blockWhenExhausted = DEFAULT_BLOCK_WHEN_EXHAUSTED;
+198
+199    private boolean jmxEnabled = DEFAULT_JMX_ENABLE;
+200
+201    // TODO Consider changing this to a single property for 3.x
+202    private String jmxNamePrefix = DEFAULT_JMX_NAME_PREFIX;
+203
+204    private String jmxNameBase = DEFAULT_JMX_NAME_BASE;
+205
+206
+207    /**
+208     * Get the value for the {@code lifo} configuration attribute for pools
+209     * created with this configuration instance.
+210     *
+211     * @return  The current setting of {@code lifo} for this configuration
+212     *          instance
+213     *
+214     * @see GenericObjectPool#getLifo()
+215     * @see GenericKeyedObjectPool#getLifo()
+216     */
+217    public boolean getLifo() {
+218        return lifo;
+219    }
+220
+221    /**
+222     * Get the value for the {@code fairness} configuration attribute for pools
+223     * created with this configuration instance.
+224     *
+225     * @return  The current setting of {@code fairness} for this configuration
+226     *          instance
+227     *
+228     * @see GenericObjectPool#getFairness()
+229     * @see GenericKeyedObjectPool#getFairness()
+230     */
+231    public boolean getFairness() {
+232        return fairness;
+233    }
+234
+235    /**
+236     * Set the value for the {@code lifo} configuration attribute for pools
+237     * created with this configuration instance.
+238     *
+239     * @param lifo The new setting of {@code lifo}
+240     *        for this configuration instance
+241     *
+242     * @see GenericObjectPool#getLifo()
+243     * @see GenericKeyedObjectPool#getLifo()
+244     */
+245    public void setLifo(final boolean lifo) {
+246        this.lifo = lifo;
+247    }
+248
+249    /**
+250     * Set the value for the {@code fairness} configuration attribute for pools
+251     * created with this configuration instance.
+252     *
+253     * @param fairness The new setting of {@code fairness}
+254     *        for this configuration instance
+255     *
+256     * @see GenericObjectPool#getFairness()
+257     * @see GenericKeyedObjectPool#getFairness()
+258     */
+259    public void setFairness(final boolean fairness) {
+260        this.fairness = fairness;
+261    }
+262
+263    /**
+264     * Get the value for the {@code maxWait} configuration attribute for pools
+265     * created with this configuration instance.
+266     *
+267     * @return  The current setting of {@code maxWait} for this
+268     *          configuration instance
+269     *
+270     * @see GenericObjectPool#getMaxWaitMillis()
+271     * @see GenericKeyedObjectPool#getMaxWaitMillis()
+272     */
+273    public long getMaxWaitMillis() {
+274        return maxWaitMillis;
+275    }
+276
+277    /**
+278     * Set the value for the {@code maxWait} configuration attribute for pools
+279     * created with this configuration instance.
+280     *
+281     * @param maxWaitMillis The new setting of {@code maxWaitMillis}
+282     *        for this configuration instance
+283     *
+284     * @see GenericObjectPool#getMaxWaitMillis()
+285     * @see GenericKeyedObjectPool#getMaxWaitMillis()
+286     */
+287    public void setMaxWaitMillis(final long maxWaitMillis) {
+288        this.maxWaitMillis = maxWaitMillis;
+289    }
+290
+291    /**
+292     * Get the value for the {@code minEvictableIdleTimeMillis} configuration
+293     * attribute for pools created with this configuration instance.
+294     *
+295     * @return  The current setting of {@code minEvictableIdleTimeMillis} for
+296     *          this configuration instance
+297     *
+298     * @see GenericObjectPool#getMinEvictableIdleTimeMillis()
+299     * @see GenericKeyedObjectPool#getMinEvictableIdleTimeMillis()
+300     */
+301    public long getMinEvictableIdleTimeMillis() {
+302        return minEvictableIdleTimeMillis;
+303    }
+304
+305    /**
+306     * Set the value for the {@code minEvictableIdleTimeMillis} configuration
+307     * attribute for pools created with this configuration instance.
+308     *
+309     * @param minEvictableIdleTimeMillis The new setting of
+310     *        {@code minEvictableIdleTimeMillis} for this configuration instance
+311     *
+312     * @see GenericObjectPool#getMinEvictableIdleTimeMillis()
+313     * @see GenericKeyedObjectPool#getMinEvictableIdleTimeMillis()
+314     */
+315    public void setMinEvictableIdleTimeMillis(final long minEvictableIdleTimeMillis) {
+316        this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
+317    }
+318
+319    /**
+320     * Get the value for the {@code softMinEvictableIdleTimeMillis}
+321     * configuration attribute for pools created with this configuration
+322     * instance.
+323     *
+324     * @return  The current setting of {@code softMinEvictableIdleTimeMillis}
+325     *          for this configuration instance
+326     *
+327     * @see GenericObjectPool#getSoftMinEvictableIdleTimeMillis()
+328     * @see GenericKeyedObjectPool#getSoftMinEvictableIdleTimeMillis()
+329     */
+330    public long getSoftMinEvictableIdleTimeMillis() {
+331        return softMinEvictableIdleTimeMillis;
+332    }
+333
+334    /**
+335     * Set the value for the {@code softMinEvictableIdleTimeMillis}
+336     * configuration attribute for pools created with this configuration
+337     * instance.
+338     *
+339     * @param softMinEvictableIdleTimeMillis The new setting of
+340     *        {@code softMinEvictableIdleTimeMillis} for this configuration
+341     *        instance
+342     *
+343     * @see GenericObjectPool#getSoftMinEvictableIdleTimeMillis()
+344     * @see GenericKeyedObjectPool#getSoftMinEvictableIdleTimeMillis()
+345     */
+346    public void setSoftMinEvictableIdleTimeMillis(
+347            final long softMinEvictableIdleTimeMillis) {
+348        this.softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;
+349    }
+350
+351    /**
+352     * Get the value for the {@code numTestsPerEvictionRun} configuration
+353     * attribute for pools created with this configuration instance.
+354     *
+355     * @return  The current setting of {@code numTestsPerEvictionRun} for this
+356     *          configuration instance
+357     *
+358     * @see GenericObjectPool#getNumTestsPerEvictionRun()
+359     * @see GenericKeyedObjectPool#getNumTestsPerEvictionRun()
+360     */
+361    public int getNumTestsPerEvictionRun() {
+362        return numTestsPerEvictionRun;
+363    }
+364
+365    /**
+366     * Set the value for the {@code numTestsPerEvictionRun} configuration
+367     * attribute for pools created with this configuration instance.
+368     *
+369     * @param numTestsPerEvictionRun The new setting of
+370     *        {@code numTestsPerEvictionRun} for this configuration instance
+371     *
+372     * @see GenericObjectPool#getNumTestsPerEvictionRun()
+373     * @see GenericKeyedObjectPool#getNumTestsPerEvictionRun()
+374     */
+375    public void setNumTestsPerEvictionRun(final int numTestsPerEvictionRun) {
+376        this.numTestsPerEvictionRun = numTestsPerEvictionRun;
+377    }
+378
+379    /**
+380     * Get the value for the {@code evictorShutdownTimeoutMillis} configuration
+381     * attribute for pools created with this configuration instance.
+382     *
+383     * @return  The current setting of {@code evictorShutdownTimeoutMillis} for
+384     *          this configuration instance
+385     *
+386     * @see GenericObjectPool#getEvictorShutdownTimeoutMillis()
+387     * @see GenericKeyedObjectPool#getEvictorShutdownTimeoutMillis()
+388     */
+389    public long getEvictorShutdownTimeoutMillis() {
+390        return evictorShutdownTimeoutMillis;
+391    }
+392
+393    /**
+394     * Set the value for the {@code evictorShutdownTimeoutMillis} configuration
+395     * attribute for pools created with this configuration instance.
+396     *
+397     * @param evictorShutdownTimeoutMillis The new setting of
+398     *        {@code evictorShutdownTimeoutMillis} for this configuration
+399     *        instance
+400     *
+401     * @see GenericObjectPool#getEvictorShutdownTimeoutMillis()
+402     * @see GenericKeyedObjectPool#getEvictorShutdownTimeoutMillis()
+403     */
+404    public void setEvictorShutdownTimeoutMillis(
+405            final long evictorShutdownTimeoutMillis) {
+406        this.evictorShutdownTimeoutMillis = evictorShutdownTimeoutMillis;
+407    }
+408
+409    /**
+410     * Get the value for the {@code testOnCreate} configuration attribute for
+411     * pools created with this configuration instance.
+412     *
+413     * @return  The current setting of {@code testOnCreate} for this
+414     *          configuration instance
+415     *
+416     * @see GenericObjectPool#getTestOnCreate()
+417     * @see GenericKeyedObjectPool#getTestOnCreate()
+418     *
+419     * @since 2.2
+420     */
+421    public boolean getTestOnCreate() {
+422        return testOnCreate;
+423    }
+424
+425    /**
+426     * Set the value for the {@code testOnCreate} configuration attribute for
+427     * pools created with this configuration instance.
+428     *
+429     * @param testOnCreate The new setting of {@code testOnCreate}
+430     *        for this configuration instance
+431     *
+432     * @see GenericObjectPool#getTestOnCreate()
+433     * @see GenericKeyedObjectPool#getTestOnCreate()
+434     *
+435     * @since 2.2
+436     */
+437    public void setTestOnCreate(final boolean testOnCreate) {
+438        this.testOnCreate = testOnCreate;
+439    }
+440
+441    /**
+442     * Get the value for the {@code testOnBorrow} configuration attribute for
+443     * pools created with this configuration instance.
+444     *
+445     * @return  The current setting of {@code testOnBorrow} for this
+446     *          configuration instance
+447     *
+448     * @see GenericObjectPool#getTestOnBorrow()
+449     * @see GenericKeyedObjectPool#getTestOnBorrow()
+450     */
+451    public boolean getTestOnBorrow() {
+452        return testOnBorrow;
+453    }
+454
+455    /**
+456     * Set the value for the {@code testOnBorrow} configuration attribute for
+457     * pools created with this configuration instance.
+458     *
+459     * @param testOnBorrow The new setting of {@code testOnBorrow}
+460     *        for this configuration instance
+461     *
+462     * @see GenericObjectPool#getTestOnBorrow()
+463     * @see GenericKeyedObjectPool#getTestOnBorrow()
+464     */
+465    public void setTestOnBorrow(final boolean testOnBorrow) {
+466        this.testOnBorrow = testOnBorrow;
+467    }
+468
+469    /**
+470     * Get the value for the {@code testOnReturn} configuration attribute for
+471     * pools created with this configuration instance.
+472     *
+473     * @return  The current setting of {@code testOnReturn} for this
+474     *          configuration instance
+475     *
+476     * @see GenericObjectPool#getTestOnReturn()
+477     * @see GenericKeyedObjectPool#getTestOnReturn()
+478     */
+479    public boolean getTestOnReturn() {
+480        return testOnReturn;
+481    }
+482
+483    /**
+484     * Set the value for the {@code testOnReturn} configuration attribute for
+485     * pools created with this configuration instance.
+486     *
+487     * @param testOnReturn The new setting of {@code testOnReturn}
+488     *        for this configuration instance
+489     *
+490     * @see GenericObjectPool#getTestOnReturn()
+491     * @see GenericKeyedObjectPool#getTestOnReturn()
+492     */
+493    public void setTestOnReturn(final boolean testOnReturn) {
+494        this.testOnReturn = testOnReturn;
+495    }
+496
+497    /**
+498     * Get the value for the {@code testWhileIdle} configuration attribute for
+499     * pools created with this configuration instance.
+500     *
+501     * @return  The current setting of {@code testWhileIdle} for this
+502     *          configuration instance
+503     *
+504     * @see GenericObjectPool#getTestWhileIdle()
+505     * @see GenericKeyedObjectPool#getTestWhileIdle()
+506     */
+507    public boolean getTestWhileIdle() {
+508        return testWhileIdle;
+509    }
+510
+511    /**
+512     * Set the value for the {@code testWhileIdle} configuration attribute for
+513     * pools created with this configuration instance.
+514     *
+515     * @param testWhileIdle The new setting of {@code testWhileIdle}
+516     *        for this configuration instance
+517     *
+518     * @see GenericObjectPool#getTestWhileIdle()
+519     * @see GenericKeyedObjectPool#getTestWhileIdle()
+520     */
+521    public void setTestWhileIdle(final boolean testWhileIdle) {
+522        this.testWhileIdle = testWhileIdle;
+523    }
+524
+525    /**
+526     * Get the value for the {@code timeBetweenEvictionRunsMillis} configuration
+527     * attribute for pools created with this configuration instance.
+528     *
+529     * @return  The current setting of {@code timeBetweenEvictionRunsMillis} for
+530     *          this configuration instance
+531     *
+532     * @see GenericObjectPool#getTimeBetweenEvictionRunsMillis()
+533     * @see GenericKeyedObjectPool#getTimeBetweenEvictionRunsMillis()
+534     */
+535    public long getTimeBetweenEvictionRunsMillis() {
+536        return timeBetweenEvictionRunsMillis;
+537    }
+538
+539    /**
+540     * Set the value for the {@code timeBetweenEvictionRunsMillis} configuration
+541     * attribute for pools created with this configuration instance.
+542     *
+543     * @param timeBetweenEvictionRunsMillis The new setting of
+544     *        {@code timeBetweenEvictionRunsMillis} for this configuration
+545     *        instance
+546     *
+547     * @see GenericObjectPool#getTimeBetweenEvictionRunsMillis()
+548     * @see GenericKeyedObjectPool#getTimeBetweenEvictionRunsMillis()
+549     */
+550    public void setTimeBetweenEvictionRunsMillis(
+551            final long timeBetweenEvictionRunsMillis) {
+552        this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
+553    }
+554
+555    /**
+556     * Get the value for the {@code evictionPolicyClassName} configuration
+557     * attribute for pools created with this configuration instance.
+558     *
+559     * @return  The current setting of {@code evictionPolicyClassName} for this
+560     *          configuration instance
+561     *
+562     * @see GenericObjectPool#getEvictionPolicyClassName()
+563     * @see GenericKeyedObjectPool#getEvictionPolicyClassName()
+564     */
+565    public String getEvictionPolicyClassName() {
+566        return evictionPolicyClassName;
+567    }
+568
+569    /**
+570     * Set the value for the {@code evictionPolicyClassName} configuration
+571     * attribute for pools created with this configuration instance.
+572     *
+573     * @param evictionPolicyClassName The new setting of
+574     *        {@code evictionPolicyClassName} for this configuration instance
+575     *
+576     * @see GenericObjectPool#getEvictionPolicyClassName()
+577     * @see GenericKeyedObjectPool#getEvictionPolicyClassName()
+578     */
+579    public void setEvictionPolicyClassName(final String evictionPolicyClassName) {
+580        this.evictionPolicyClassName = evictionPolicyClassName;
+581    }
+582
+583    /**
+584     * Get the value for the {@code blockWhenExhausted} configuration attribute
+585     * for pools created with this configuration instance.
+586     *
+587     * @return  The current setting of {@code blockWhenExhausted} for this
+588     *          configuration instance
+589     *
+590     * @see GenericObjectPool#getBlockWhenExhausted()
+591     * @see GenericKeyedObjectPool#getBlockWhenExhausted()
+592     */
+593    public boolean getBlockWhenExhausted() {
+594        return blockWhenExhausted;
+595    }
+596
+597    /**
+598     * Set the value for the {@code blockWhenExhausted} configuration attribute
+599     * for pools created with this configuration instance.
+600     *
+601     * @param blockWhenExhausted The new setting of {@code blockWhenExhausted}
+602     *        for this configuration instance
+603     *
+604     * @see GenericObjectPool#getBlockWhenExhausted()
+605     * @see GenericKeyedObjectPool#getBlockWhenExhausted()
+606     */
+607    public void setBlockWhenExhausted(final boolean blockWhenExhausted) {
+608        this.blockWhenExhausted = blockWhenExhausted;
+609    }
+610
+611    /**
+612     * Gets the value of the flag that determines if JMX will be enabled for
+613     * pools created with this configuration instance.
+614     *
+615     * @return  The current setting of {@code jmxEnabled} for this configuration
+616     *          instance
+617     */
+618    public boolean getJmxEnabled() {
+619        return jmxEnabled;
+620    }
+621
+622    /**
+623     * Sets the value of the flag that determines if JMX will be enabled for
+624     * pools created with this configuration instance.
+625     *
+626     * @param jmxEnabled The new setting of {@code jmxEnabled}
+627     *        for this configuration instance
+628     */
+629    public void setJmxEnabled(final boolean jmxEnabled) {
+630        this.jmxEnabled = jmxEnabled;
+631    }
+632
+633    /**
+634     * Gets the value of the JMX name base that will be used as part of the
+635     * name assigned to JMX enabled pools created with this configuration
+636     * instance. A value of <code>null</code> means that the pool will define
+637     * the JMX name base.
+638     *
+639     * @return  The current setting of {@code jmxNameBase} for this
+640     *          configuration instance
+641     */
+642    public String getJmxNameBase() {
+643        return jmxNameBase;
+644    }
+645
+646    /**
+647     * Sets the value of the JMX name base that will be used as part of the
+648     * name assigned to JMX enabled pools created with this configuration
+649     * instance. A value of <code>null</code> means that the pool will define
+650     * the JMX name base.
+651     *
+652     * @param jmxNameBase The new setting of {@code jmxNameBase}
+653     *        for this configuration instance
+654     */
+655    public void setJmxNameBase(final String jmxNameBase) {
+656        this.jmxNameBase = jmxNameBase;
+657    }
+658
+659    /**
+660     * Gets the value of the JMX name prefix that will be used as part of the
+661     * name assigned to JMX enabled pools created with this configuration
+662     * instance.
+663     *
+664     * @return  The current setting of {@code jmxNamePrefix} for this
+665     *          configuration instance
+666     */
+667    public String getJmxNamePrefix() {
+668        return jmxNamePrefix;
+669    }
+670
+671    /**
+672     * Sets the value of the JMX name prefix that will be used as part of the
+673     * name assigned to JMX enabled pools created with this configuration
+674     * instance.
+675     *
+676     * @param jmxNamePrefix The new setting of {@code jmxNamePrefix}
+677     *        for this configuration instance
+678     */
+679    public void setJmxNamePrefix(final String jmxNamePrefix) {
+680        this.jmxNamePrefix = jmxNamePrefix;
+681    }
+682
+683    @Override
+684    protected void toStringAppendFields(final StringBuilder builder) {
+685        builder.append("lifo=");
+686        builder.append(lifo);
+687        builder.append(", fairness=");
+688        builder.append(fairness);
+689        builder.append(", maxWaitMillis=");
+690        builder.append(maxWaitMillis);
+691        builder.append(", minEvictableIdleTimeMillis=");
+692        builder.append(minEvictableIdleTimeMillis);
+693        builder.append(", softMinEvictableIdleTimeMillis=");
+694        builder.append(softMinEvictableIdleTimeMillis);
+695        builder.append(", numTestsPerEvictionRun=");
+696        builder.append(numTestsPerEvictionRun);
+697        builder.append(", evictionPolicyClassName=");
+698        builder.append(evictionPolicyClassName);
+699        builder.append(", testOnCreate=");
+700        builder.append(testOnCreate);
+701        builder.append(", testOnBorrow=");
+702        builder.append(testOnBorrow);
+703        builder.append(", testOnReturn=");
+704        builder.append(testOnReturn);
+705        builder.append(", testWhileIdle=");
+706        builder.append(testWhileIdle);
+707        builder.append(", timeBetweenEvictionRunsMillis=");
+708        builder.append(timeBetweenEvictionRunsMillis);
+709        builder.append(", blockWhenExhausted=");
+710        builder.append(blockWhenExhausted);
+711        builder.append(", jmxEnabled=");
+712        builder.append(jmxEnabled);
+713        builder.append(", jmxNamePrefix=");
+714        builder.append(jmxNamePrefix);
+715        builder.append(", jmxNameBase=");
+716        builder.append(jmxNameBase);
+717    }
+718}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + Added: websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/CallStack.html ============================================================================== --- websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/CallStack.html (added) +++ websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/CallStack.html Sat Oct 28 18:29:09 2017 @@ -0,0 +1,126 @@ + + + +Source code + + + +
+
001/*
+002 * Licensed to the Apache Software Foundation (ASF) under one or more
+003 * contributor license agreements. See the NOTICE file distributed with
+004 * this work for additional information regarding copyright ownership.
+005 * The ASF licenses this file to You under the Apache license, Version 2.0
+006 * (the "License"); you may not use this file except in compliance with
+007 * the License. You may obtain a copy of the License at
+008 *
+009 *      http://www.apache.org/licenses/LICENSE-2.0
+010 *
+011 * Unless required by applicable law or agreed to in writing, software
+012 * distributed under the License is distributed on an "AS IS" BASIS,
+013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+014 * See the license for the specific language governing permissions and
+015 * limitations under the license.
+016 */
+017package org.apache.commons.pool2.impl;
+018
+019import org.apache.commons.pool2.PooledObject;
+020import org.apache.commons.pool2.UsageTracking;
+021
+022import java.io.PrintWriter;
+023
+024/**
+025 * Strategy for obtaining and printing the current call stack. This is primarily useful for
+026 * {@linkplain UsageTracking usage tracking} so that different JVMs and configurations can use more efficient strategies
+027 * for obtaining the current call stack.
+028 *
+029 * @see CallStackUtils
+030 * @since 2.4.3
+031 */
+032public interface CallStack {
+033
+034    /**
+035     * Prints the current stack trace if available to a PrintWriter. The format is undefined and is primarily useful
+036     * for debugging issues with {@link PooledObject} usage in user code.
+037     *
+038     * @param writer a PrintWriter to write the curren stack trace to if available
+039     * @return true if a stack trace was available to print or false if nothing was printed
+040     */
+041    boolean printStackTrace(final PrintWriter writer);
+042
+043    /**
+044     * Takes a snapshot of the current call stack. Subsequent calls to {@link #printStackTrace(PrintWriter)} will print
+045     * out that stack trace until it is {@linkplain #clear() cleared}.
+046     */
+047    void fillInStackTrace();
+048
+049    /**
+050     * Clears the current stack trace snapshot. Subsequent calls to {@link #printStackTrace(PrintWriter)} will be
+051     * no-ops until another call to {@link #fillInStackTrace()}.
+052     */
+053    void clear();
+054}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + Added: websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/CallStackUtils.html ============================================================================== --- websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/CallStackUtils.html (added) +++ websites/production/commons/content/proper/commons-pool/api-2.4.3/src-html/org/apache/commons/pool2/impl/CallStackUtils.html Sat Oct 28 18:29:09 2017 @@ -0,0 +1,134 @@ + + + +Source code + + + +
+
001/*
+002 * Licensed to the Apache Software Foundation (ASF) under one or more
+003 * contributor license agreements. See the NOTICE file distributed with
+004 * this work for additional information regarding copyright ownership.
+005 * The ASF licenses this file to You under the Apache license, Version 2.0
+006 * (the "License"); you may not use this file except in compliance with
+007 * the License. You may obtain a copy of the License at
+008 *
+009 *      http://www.apache.org/licenses/LICENSE-2.0
+010 *
+011 * Unless required by applicable law or agreed to in writing, software
+012 * distributed under the License is distributed on an "AS IS" BASIS,
+013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+014 * See the license for the specific language governing permissions and
+015 * limitations under the license.
+016 */
+017package org.apache.commons.pool2.impl;
+018
+019import java.security.AccessControlException;
+020
+021/**
+022 * Utility methods for {@link CallStack}.
+023 *
+024 * @since 2.4.3
+025 */
+026public final class CallStackUtils {
+027
+028    private static final boolean CAN_CREATE_SECURITY_MANAGER;
+029
+030    static {
+031        CAN_CREATE_SECURITY_MANAGER = canCreateSecurityManager();
+032    }
+033
+034    private static boolean canCreateSecurityManager() {
+035        final SecurityManager manager = System.getSecurityManager();
+036        if (manager == null) {
+037            return true;
+038        }
+039        try {
+040            manager.checkPermission(new RuntimePermission("createSecurityManager"));
+041            return true;
+042        } catch (final AccessControlException ignored) {
+043            return false;
+044        }
+045    }
+046
+047    /**
+048     * Constructs a new {@link CallStack} using the fastest allowed strategy.
+049     *
+050     * @param messageFormat message (or format) to print first in stack traces
+051     * @param useTimestamp  if true, interpret message as a SimpleDateFormat and print the created timestamp; otherwise,
+052     *                      print message format literally
+053     * @return a new CallStack
+054     */
+055    public static CallStack newCallStack(final String messageFormat, final boolean useTimestamp) {
+056        return CAN_CREATE_SECURITY_MANAGER ? new SecurityManagerCallStack(messageFormat, useTimestamp)
+057            : new ThrowableCallStack(messageFormat, useTimestamp);
+058    }
+059
+060    private CallStackUtils() {
+061    }
+062}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +