📄 generickeyedobjectpool.html
字号:
Sets the minimum number of idle objects in pool to maintain (per key)</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setNumTestsPerEvictionRun(int)">setNumTestsPerEvictionRun</A></B>(int numTestsPerEvictionRun)</CODE><BR> Sets the number of objects to examine during each run of the idle object evictor thread (if any).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setTestOnBorrow(boolean)">setTestOnBorrow</A></B>(boolean testOnBorrow)</CODE><BR> When <tt>true</tt>, objects will be <A HREF="../../../../../org/apache/commons/pool/PoolableObjectFactory.html#validateObject(java.lang.Object)"><CODE>validated</CODE></A> before being returned by the <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowObject(java.lang.Object)</CODE></A> method.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setTestOnReturn(boolean)">setTestOnReturn</A></B>(boolean testOnReturn)</CODE><BR> When <tt>true</tt>, objects will be <A HREF="../../../../../org/apache/commons/pool/PoolableObjectFactory.html#validateObject(java.lang.Object)"><CODE>validated</CODE></A> before being returned to the pool within the <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)"><CODE>returnObject(java.lang.Object, java.lang.Object)</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setTestWhileIdle(boolean)">setTestWhileIdle</A></B>(boolean testWhileIdle)</CODE><BR> When <tt>true</tt>, objects will be <A HREF="../../../../../org/apache/commons/pool/PoolableObjectFactory.html#validateObject(java.lang.Object)"><CODE>validated</CODE></A> by the idle object evictor (if any).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setTimeBetweenEvictionRunsMillis(long)">setTimeBetweenEvictionRunsMillis</A></B>(long timeBetweenEvictionRunsMillis)</CODE><BR> Sets the number of milliseconds to sleep between runs of the idle object evictor thread.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setWhenExhaustedAction(byte)">setWhenExhaustedAction</A></B>(byte whenExhaustedAction)</CODE><BR> Sets the action to take when the <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowObject(java.lang.Object)</CODE></A> method is invoked when the pool is exhausted (the maximum number of "active" objects has been reached).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#startEvictor(long)">startEvictor</A></B>(long delay)</CODE><BR> Start the eviction thread or service, or when <i>delay</i> is non-positive, stop it if it is already running.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Field Detail</B></FONT></TH></TR></TABLE><A NAME="WHEN_EXHAUSTED_FAIL"><!-- --></A><H3>WHEN_EXHAUSTED_FAIL</H3><PRE>public static final byte <B>WHEN_EXHAUSTED_FAIL</B></PRE><DL><DD>A "when exhausted action" type indicating that when the pool is exhausted (i.e., the maximum number of active objects has been reached), the <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowObject(java.lang.Object)</CODE></A> method should fail, throwing a <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/NoSuchElementException.html" title="class or interface in java.util"><CODE>NoSuchElementException</CODE></A>.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#WHEN_EXHAUSTED_BLOCK"><CODE>WHEN_EXHAUSTED_BLOCK</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#WHEN_EXHAUSTED_GROW"><CODE>WHEN_EXHAUSTED_GROW</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setWhenExhaustedAction(byte)"><CODE>setWhenExhaustedAction(byte)</CODE></A>, <A HREF="../../../../../constant-values.html#org.apache.commons.pool.impl.GenericKeyedObjectPool.WHEN_EXHAUSTED_FAIL">Constant Field Values</A></DL></DL><HR><A NAME="WHEN_EXHAUSTED_BLOCK"><!-- --></A><H3>WHEN_EXHAUSTED_BLOCK</H3><PRE>public static final byte <B>WHEN_EXHAUSTED_BLOCK</B></PRE><DL><DD>A "when exhausted action" type indicating that when the pool is exhausted (i.e., the maximum number of active objects has been reached), the <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowObject(java.lang.Object)</CODE></A> method should block until a new object is available, or the <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#getMaxWait()"><CODE>maximum wait time</CODE></A> has been reached.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#WHEN_EXHAUSTED_FAIL"><CODE>WHEN_EXHAUSTED_FAIL</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#WHEN_EXHAUSTED_GROW"><CODE>WHEN_EXHAUSTED_GROW</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setMaxWait(long)"><CODE>setMaxWait(long)</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#getMaxWait()"><CODE>getMaxWait()</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setWhenExhaustedAction(byte)"><CODE>setWhenExhaustedAction(byte)</CODE></A>, <A HREF="../../../../../constant-values.html#org.apache.commons.pool.impl.GenericKeyedObjectPool.WHEN_EXHAUSTED_BLOCK">Constant Field Values</A></DL></DL><HR><A NAME="WHEN_EXHAUSTED_GROW"><!-- --></A><H3>WHEN_EXHAUSTED_GROW</H3><PRE>public static final byte <B>WHEN_EXHAUSTED_GROW</B></PRE><DL><DD>A "when exhausted action" type indicating that when the pool is exhausted (i.e., the maximum number of active objects has been reached), the <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowObject(java.lang.Object)</CODE></A> method should simply create a new object anyway.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#WHEN_EXHAUSTED_FAIL"><CODE>WHEN_EXHAUSTED_FAIL</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#WHEN_EXHAUSTED_GROW"><CODE>WHEN_EXHAUSTED_GROW</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setWhenExhaustedAction(byte)"><CODE>setWhenExhaustedAction(byte)</CODE></A>, <A HREF="../../../../../constant-values.html#org.apache.commons.pool.impl.GenericKeyedObjectPool.WHEN_EXHAUSTED_GROW">Constant Field Values</A></DL></DL><HR><A NAME="DEFAULT_MAX_IDLE"><!-- --></A><H3>DEFAULT_MAX_IDLE</H3><PRE>public static final int <B>DEFAULT_MAX_IDLE</B></PRE><DL><DD>The default cap on the number of idle instances in the pool (per key).<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#getMaxIdle()"><CODE>getMaxIdle()</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setMaxIdle(int)"><CODE>setMaxIdle(int)</CODE></A>, <A HREF="../../../../../constant-values.html#org.apache.commons.pool.impl.GenericKeyedObjectPool.DEFAULT_MAX_IDLE">Constant Field Values</A></DL></DL><HR><A NAME="DEFAULT_MAX_ACTIVE"><!-- --></A><H3>DEFAULT_MAX_ACTIVE</H3><PRE>public static final int <B>DEFAULT_MAX_ACTIVE</B></PRE><DL><DD>The default cap on the total number of active instances from the pool (per key).<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#getMaxActive()"><CODE>getMaxActive()</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setMaxActive(int)"><CODE>setMaxActive(int)</CODE></A>, <A HREF="../../../../../constant-values.html#org.apache.commons.pool.impl.GenericKeyedObjectPool.DEFAULT_MAX_ACTIVE">Constant Field Values</A></DL></DL><HR><A NAME="DEFAULT_MAX_TOTAL"><!-- --></A><H3>DEFAULT_MAX_TOTAL</H3><PRE>public static final int <B>DEFAULT_MAX_TOTAL</B></PRE><DL><DD>The default cap on the the maximum number of objects that can exists at one time.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#getMaxTotal()"><CODE>getMaxTotal()</CODE></A>, <A HREF="../../../../../org/apache/commons/pool/impl/GenericKeyedObjectPool.html#setMaxTotal(int)"><CODE>setMaxTotal(int)</CODE></A>, <A HREF="../../../../../constant-values.html#org.apache.commons.pool.impl.GenericKeyedObjectPool.DEFAULT_MAX_TOTAL">Constant Field Values</A></DL></DL><HR><A NAME="DEFAULT_WHEN_EXHAUSTED_ACTION"><!-- --></A><H3>DEFAULT_WHEN_EXHAUSTED_ACTION</H3><PRE>public static final byte <B>DEFAULT_WHEN_EXHAUSTED_ACTION</B></PRE><DL><DD>The default "when exhausted action" for th
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -