⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 generickeyedobjectpool.html

📁 优秀的文档,可以学习java之用 0006728337 00000 n 0006728424 00000 n 0006728600 00000 n
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="248" href="#248">248</a> <em>     * @see #setNumTestsPerEvictionRun</em><a name="249" href="#249">249</a> <em>     * @see #getTimeBetweenEvictionRunsMillis</em><a name="250" href="#250">250</a> <em>     * @see #setTimeBetweenEvictionRunsMillis</em><a name="251" href="#251">251</a> <em>     */</em><a name="252" href="#252">252</a>     <strong>public</strong> <strong>static</strong> <strong>final</strong> <strong>int</strong> DEFAULT_NUM_TESTS_PER_EVICTION_RUN = 3;<a name="253" href="#253">253</a> <a name="254" href="#254">254</a>     <em>/**<em>*</em></em><a name="255" href="#255">255</a> <em>     * The default value for {@link #getMinEvictableIdleTimeMillis}.</em><a name="256" href="#256">256</a> <em>     * @see #getMinEvictableIdleTimeMillis</em><a name="257" href="#257">257</a> <em>     * @see #setMinEvictableIdleTimeMillis</em><a name="258" href="#258">258</a> <em>     */</em><a name="259" href="#259">259</a>     <strong>public</strong> <strong>static</strong> <strong>final</strong> <strong>long</strong> DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS = 1000L * 60L * 30L;<a name="260" href="#260">260</a> <a name="261" href="#261">261</a>     <em>/**<em>*</em></em><a name="262" href="#262">262</a> <em>     * The default minimum level of idle objects in the pool.</em><a name="263" href="#263">263</a> <em>     * @see #setMinIdle</em><a name="264" href="#264">264</a> <em>     * @see #getMinIdle</em><a name="265" href="#265">265</a> <em>     */</em><a name="266" href="#266">266</a>     <strong>public</strong> <strong>static</strong> <strong>final</strong> <strong>int</strong> DEFAULT_MIN_IDLE = 0;<a name="267" href="#267">267</a>     <a name="268" href="#268">268</a>     <em class="comment">//--- constructors -----------------------------------------------</em><a name="269" href="#269">269</a> <a name="270" href="#270">270</a>     <em>/**<em>*</em></em><a name="271" href="#271">271</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt>..</em><a name="272" href="#272">272</a> <em>     */</em><a name="273" href="#273">273</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>() {<a name="274" href="#274">274</a>         <strong>this</strong>(<strong>null</strong>,DEFAULT_MAX_ACTIVE,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_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);<a name="275" href="#275">275</a>     }<a name="276" href="#276">276</a> <a name="277" href="#277">277</a>     <em>/**<em>*</em></em><a name="278" href="#278">278</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="279" href="#279">279</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)KeyedPoolableObjectFactory to use to create, validate and destroy objects</em><a name="280" href="#280">280</a> <em>     */</em><a name="281" href="#281">281</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>(<a href="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html">KeyedPoolableObjectFactory</a> factory) {<a name="282" href="#282">282</a>         <strong>this</strong>(factory,DEFAULT_MAX_ACTIVE,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_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);<a name="283" href="#283">283</a>     }<a name="284" href="#284">284</a> <a name="285" href="#285">285</a>     <em>/**<em>*</em></em><a name="286" href="#286">286</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="287" href="#287">287</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)KeyedPoolableObjectFactory to use to create, validate and destroy objects</em><a name="288" href="#288">288</a> <em>     * @param config a non-&lt;tt>null&lt;/tt> {@link GenericKeyedObjectPool.Config} describing my configuration</em><a name="289" href="#289">289</a> <em>     */</em><a name="290" href="#290">290</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>(<a href="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html">KeyedPoolableObjectFactory</a> factory, GenericKeyedObjectPool.Config config) {<a name="291" href="#291">291</a>         <strong>this</strong>(factory,config.maxActive,config.whenExhaustedAction,config.maxWait,config.maxIdle,config.maxTotal,config.testOnBorrow,config.testOnReturn,config.timeBetweenEvictionRunsMillis,config.numTestsPerEvictionRun,config.minEvictableIdleTimeMillis,config.testWhileIdle);<a name="292" href="#292">292</a>     }<a name="293" href="#293">293</a> <a name="294" href="#294">294</a>     <em>/**<em>*</em></em><a name="295" href="#295">295</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="296" href="#296">296</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)KeyedPoolableObjectFactory to use to create, validate and destroy objects</em><a name="297" href="#297">297</a> <em>     * @param maxActive the maximum number of objects that can be borrowed from me at one time (per key) (see {@link #setMaxActive})</em><a name="298" href="#298">298</a> <em>     */</em><a name="299" href="#299">299</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>(<a href="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html">KeyedPoolableObjectFactory</a> factory, <strong>int</strong> maxActive) {<a name="300" href="#300">300</a>         <strong>this</strong>(factory,maxActive,DEFAULT_WHEN_EXHAUSTED_ACTION,DEFAULT_MAX_WAIT,DEFAULT_MAX_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);<a name="301" href="#301">301</a>     }<a name="302" href="#302">302</a> <a name="303" href="#303">303</a>     <em>/**<em>*</em></em><a name="304" href="#304">304</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="305" href="#305">305</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)KeyedPoolableObjectFactory to use to create, validate and destroy objects</em><a name="306" href="#306">306</a> <em>     * @param maxActive the maximum number of objects that can be borrowed from me at one time (per key) (see {@link #setMaxActive})</em><a name="307" href="#307">307</a> <em>     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})</em><a name="308" href="#308">308</a> <em>     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and &lt;i>whenExhaustedAction&lt;/i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})</em><a name="309" href="#309">309</a> <em>     */</em><a name="310" href="#310">310</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>(<a href="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html">KeyedPoolableObjectFactory</a> factory, <strong>int</strong> maxActive, byte whenExhaustedAction, <strong>long</strong> maxWait) {<a name="311" href="#311">311</a>         <strong>this</strong>(factory,maxActive,whenExhaustedAction,maxWait,DEFAULT_MAX_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);<a name="312" href="#312">312</a>     }<a name="313" href="#313">313</a> <a name="314" href="#314">314</a>     <em>/**<em>*</em></em><a name="315" href="#315">315</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="316" href="#316">316</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)KeyedPoolableObjectFactory to use to create, validate and destroy objects</em><a name="317" href="#317">317</a> <em>     * @param maxActive the maximum number of objects that can be borrowed from me at one time (per key) (see {@link #setMaxActive})</em><a name="318" href="#318">318</a> <em>     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and &lt;i>whenExhaustedAction&lt;/i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})</em><a name="319" href="#319">319</a> <em>     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})</em><a name="320" href="#320">320</a> <em>     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject} method (see {@link #setTestOnBorrow})</em><a name="321" href="#321">321</a> <em>     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject} method (see {@link #setTestOnReturn})</em><a name="322" href="#322">322</a> <em>     */</em><a name="323" href="#323">323</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>(<a href="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html">KeyedPoolableObjectFactory</a> factory, <strong>int</strong> maxActive, byte whenExhaustedAction, <strong>long</strong> maxWait, <strong>boolean</strong> testOnBorrow, <strong>boolean</strong> testOnReturn) {<a name="324" href="#324">324</a>         <strong>this</strong>(factory,maxActive,whenExhaustedAction,maxWait,DEFAULT_MAX_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);<a name="325" href="#325">325</a>     }<a name="326" href="#326">326</a> <a name="327" href="#327">327</a>     <em>/**<em>*</em></em><a name="328" href="#328">328</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="329" href="#329">329</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)KeyedPoolableObjectFactory to use to create, validate and destroy objects</em><a name="330" href="#330">330</a> <em>     * @param maxActive the maximum number of objects that can be borrowed from me at one time (per key) (see {@link #setMaxActive})</em><a name="331" href="#331">331</a> <em>     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})</em><a name="332" href="#332">332</a> <em>     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and &lt;i>whenExhaustedAction&lt;/i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})</em><a name="333" href="#333">333</a> <em>     * @param maxIdle the maximum number of idle objects in my pool (per key) (see {@link #setMaxIdle})</em><a name="334" href="#334">334</a> <em>     */</em><a name="335" href="#335">335</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>(<a href="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html">KeyedPoolableObjectFactory</a> factory, <strong>int</strong> maxActive, byte whenExhaustedAction, <strong>long</strong> maxWait, <strong>int</strong> maxIdle) {<a name="336" href="#336">336</a>         <strong>this</strong>(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,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);<a name="337" href="#337">337</a>     }<a name="338" href="#338">338</a> <a name="339" href="#339">339</a>     <em>/**<em>*</em></em><a name="340" href="#340">340</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="341" href="#341">341</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)KeyedPoolableObjectFactory to use to create, validate and destroy objects</em><a name="342" href="#342">342</a> <em>     * @param maxActive the maximum number of objects that can be borrowed from me at one time (per key) (see {@link #setMaxActive})</em><a name="343" href="#343">343</a> <em>     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})</em><a name="344" href="#344">344</a> <em>     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and &lt;i>whenExhaustedAction&lt;/i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #getMaxWait})</em><a name="345" href="#345">345</a> <em>     * @param maxIdle the maximum number of idle objects in my pool (see {@link #setMaxIdle})</em><a name="346" href="#346">346</a> <em>     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject} method (see {@link #setTestOnBorrow})</em><a name="347" href="#347">347</a> <em>     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject} method (see {@link #setTestOnReturn})</em><a name="348" href="#348">348</a> <em>     */</em><a name="349" href="#349">349</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>(<a href="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html">KeyedPoolableObjectFactory</a> factory, <strong>int</strong> maxActive, byte whenExhaustedAction, <strong>long</strong> maxWait, <strong>int</strong> maxIdle, <strong>boolean</strong> testOnBorrow, <strong>boolean</strong> testOnReturn) {<a name="350" href="#350">350</a>         <strong>this</strong>(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,testOnBorrow,testOnReturn,DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS,DEFAULT_NUM_TESTS_PER_EVICTION_RUN,DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,DEFAULT_TEST_WHILE_IDLE);<a name="351" href="#351">351</a>     }<a name="352" href="#352">352</a> <a name="353" href="#353">353</a>     <em>/**<em>*</em></em><a name="354" href="#354">354</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="355" href="#355">355</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)PoolableObjectFactory to use to create, validate and destroy objects</em><a name="356" href="#356">356</a> <em>     * @param maxActive the maximum number of objects that can be borrowed from me at one time (per key) (see {@link #setMaxActive})</em><a name="357" href="#357">357</a> <em>     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})</em><a name="358" href="#358">358</a> <em>     * @param maxWait the maximum amount of time to wait for an idle object when the pool is exhausted an and &lt;i>whenExhaustedAction&lt;/i> is {@link #WHEN_EXHAUSTED_BLOCK} (otherwise ignored) (see {@link #setMaxWait})</em><a name="359" href="#359">359</a> <em>     * @param maxIdle the maximum number of idle objects in my pool (see {@link #setMaxIdle})</em><a name="360" href="#360">360</a> <em>     * @param testOnBorrow whether or not to validate objects before they are returned by the {@link #borrowObject} method (see {@link #setTestOnBorrow})</em><a name="361" href="#361">361</a> <em>     * @param testOnReturn whether or not to validate objects after they are returned to the {@link #returnObject} method (see {@link #setTestOnReturn})</em><a name="362" href="#362">362</a> <em>     * @param timeBetweenEvictionRunsMillis the amount of time (in milliseconds) to sleep between examining idle objects for eviction (see {@link #setTimeBetweenEvictionRunsMillis})</em><a name="363" href="#363">363</a> <em>     * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread (if any) (see {@link #setNumTestsPerEvictionRun})</em><a name="364" href="#364">364</a> <em>     * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligable for evcition (see {@link #setMinEvictableIdleTimeMillis})</em><a name="365" href="#365">365</a> <em>     * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any (see {@link #setTestWhileIdle})</em><a name="366" href="#366">366</a> <em>     */</em><a name="367" href="#367">367</a>     <strong>public</strong> <a href="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html">GenericKeyedObjectPool</a>(<a href="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html">KeyedPoolableObjectFactory</a> factory, <strong>int</strong> maxActive, byte whenExhaustedAction, <strong>long</strong> maxWait, <strong>int</strong> maxIdle, <strong>boolean</strong> testOnBorrow, <strong>boolean</strong> testOnReturn, <strong>long</strong> timeBetweenEvictionRunsMillis, <strong>int</strong> numTestsPerEvictionRun, <strong>long</strong> minEvictableIdleTimeMillis, <strong>boolean</strong> testWhileIdle) {<a name="368" href="#368">368</a>         <strong>this</strong>(factory, maxActive, whenExhaustedAction, maxWait, maxIdle, GenericKeyedObjectPool.DEFAULT_MAX_TOTAL, testOnBorrow, testOnReturn, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minEvictableIdleTimeMillis, testWhileIdle);<a name="369" href="#369">369</a>     }<a name="370" href="#370">370</a> <a name="371" href="#371">371</a>     <em>/**<em>*</em></em><a name="372" href="#372">372</a> <em>     * Create a new &lt;tt>GenericKeyedObjectPool&lt;/tt> using the specified values.</em><a name="373" href="#373">373</a> <em>     * @param factory the (possibly &lt;tt>null&lt;/tt>)PoolableObjectFactory to use to create, validate and destroy objects</em><a name="374" href="#374">374</a> <em>     * @param maxActive the maximum number of objects that can be borrowed from me at one time (per key) (see {@link #setMaxActive})</em><a name="375" href="#375">375</a> <em>     * @param whenExhaustedAction the action to take when the pool is exhausted (see {@link #setWhenExhaustedAction})</em>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -