📄 poolutils.html
字号:
<TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#checkedPool(org.apache.commons.pool.KeyedObjectPool, java.lang.Class)">checkedPool</A></B>(<A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A> keyedPool, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> type)</CODE><BR> Wraps an <code>KeyedObjectPool</code> and dynamically checks the type of objects borrowed and returned to the keyedPool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../../org/apache/commons/pool/ObjectPool.html" title="interface in org.apache.commons.pool">ObjectPool</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#checkedPool(org.apache.commons.pool.ObjectPool, java.lang.Class)">checkedPool</A></B>(<A HREF="../../../../org/apache/commons/pool/ObjectPool.html" title="interface in org.apache.commons.pool">ObjectPool</A> pool, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> type)</CODE><BR> Wraps an <code>ObjectPool</code> and dynamically checks the type of objects borrowed and returned to the keyedPool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Map.html" title="class or interface in java.util">Map</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#checkMinIdle(org.apache.commons.pool.KeyedObjectPool, java.util.Collection, int, long)">checkMinIdle</A></B>(<A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A> keyedPool, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A> keys, int minIdle, long period)</CODE><BR> Periodically check the idle object count for each key in the <code>Collection</code> <code>keys</code> in the keyedPool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/TimerTask.html" title="class or interface in java.util">TimerTask</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#checkMinIdle(org.apache.commons.pool.KeyedObjectPool, java.lang.Object, int, long)">checkMinIdle</A></B>(<A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A> keyedPool, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> key, int minIdle, long period)</CODE><BR> Periodically check the idle object count for the key in the keyedPool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/TimerTask.html" title="class or interface in java.util">TimerTask</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#checkMinIdle(org.apache.commons.pool.ObjectPool, int, long)">checkMinIdle</A></B>(<A HREF="../../../../org/apache/commons/pool/ObjectPool.html" title="interface in org.apache.commons.pool">ObjectPool</A> pool, int minIdle, long period)</CODE><BR> Periodically check the idle object count for the keyedPool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#prefill(org.apache.commons.pool.KeyedObjectPool, java.util.Collection, int)">prefill</A></B>(<A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A> keyedPool, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A> keys, int count)</CODE><BR> Call <code>addObject(Object)</code> on <code>keyedPool</code> with each key in <code>keys</code> for <code>count</code> number of times.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#prefill(org.apache.commons.pool.KeyedObjectPool, java.lang.Object, int)">prefill</A></B>(<A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A> keyedPool, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> key, int count)</CODE><BR> Call <code>addObject(Object)</code> on <code>keyedPool</code> with <code>key</code> <code>count</code> number of times.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#prefill(org.apache.commons.pool.ObjectPool, int)">prefill</A></B>(<A HREF="../../../../org/apache/commons/pool/ObjectPool.html" title="interface in org.apache.commons.pool">ObjectPool</A> pool, int count)</CODE><BR> Call <code>addObject()</code> on <code>keyedPool</code> <code>count</code> number of times.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#synchronizedPool(org.apache.commons.pool.KeyedObjectPool)">synchronizedPool</A></B>(<A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A> keyedPool)</CODE><BR> Returns a synchronized (thread-safe) KeyedObjectPool backed by the specified KeyedObjectPool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../../org/apache/commons/pool/ObjectPool.html" title="interface in org.apache.commons.pool">ObjectPool</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#synchronizedPool(org.apache.commons.pool.ObjectPool)">synchronizedPool</A></B>(<A HREF="../../../../org/apache/commons/pool/ObjectPool.html" title="interface in org.apache.commons.pool">ObjectPool</A> pool)</CODE><BR> Returns a synchronized (thread-safe) ObjectPool backed by the specified ObjectPool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool">KeyedPoolableObjectFactory</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#synchronizedPoolableFactory(org.apache.commons.pool.KeyedPoolableObjectFactory)">synchronizedPoolableFactory</A></B>(<A HREF="../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool">KeyedPoolableObjectFactory</A> keyedFactory)</CODE><BR> Returns a synchronized (thread-safe) KeyedPoolableObjectFactory backed by the specified KeyedPoolableObjectFactory.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../../../org/apache/commons/pool/PoolableObjectFactory.html" title="interface in org.apache.commons.pool">PoolableObjectFactory</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#synchronizedPoolableFactory(org.apache.commons.pool.PoolableObjectFactory)">synchronizedPoolableFactory</A></B>(<A HREF="../../../../org/apache/commons/pool/PoolableObjectFactory.html" title="interface in org.apache.commons.pool">PoolableObjectFactory</A> factory)</CODE><BR> Returns a synchronized (thread-safe) PoolableObjectFactory backed by the specified PoolableObjectFactory.</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><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_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>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="PoolUtils()"><!-- --></A><H3>PoolUtils</H3><PRE>public <B>PoolUtils</B>()</PRE><DL><DD>PoolUtils instances should NOT be constructed in standard programming. Instead, the class should be used procedurally: PoolUtils.adapt(aPool);. This constructor is public to permit tools that require a JavaBean instance to operate.<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_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>Method Detail</B></FONT></TH></TR></TABLE><A NAME="adapt(org.apache.commons.pool.KeyedPoolableObjectFactory)"><!-- --></A><H3>adapt</H3><PRE>public static <A HREF="../../../../org/apache/commons/pool/PoolableObjectFactory.html" title="interface in org.apache.commons.pool">PoolableObjectFactory</A> <B>adapt</B>(<A HREF="../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool">KeyedPoolableObjectFactory</A> keyedFactory) throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></PRE><DL><DD>Adapt a <code>KeyedPoolableObjectFactory</code> instance to work where a <code>PoolableObjectFactory</code> is needed. This method is the equivalent of calling <A HREF="../../../../org/apache/commons/pool/PoolUtils.html#adapt(org.apache.commons.pool.KeyedPoolableObjectFactory, java.lang.Object)"><CODE>PoolUtils.adapt(aKeyedPoolableObjectFactory, new Object())</CODE></A>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>keyedFactory</CODE> - the <A HREF="../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool"><CODE>KeyedPoolableObjectFactory</CODE></A> to delegate to.<DT><B>Returns:</B><DD>a <A HREF="../../../../org/apache/commons/pool/PoolableObjectFactory.html" title="interface in org.apache.commons.pool"><CODE>PoolableObjectFactory</CODE></A> that delegates to <code>keyedFactory</code> with an internal key.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - when <code>keyedFactory</code> is <code>null</code>.<DT><B>Since:</B></DT> <DD>Pool 1.3</DD><DT><B>See Also:</B><DD><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#adapt(org.apache.commons.pool.KeyedPoolableObjectFactory, java.lang.Object)"><CODE>adapt(KeyedPoolableObjectFactory, Object)</CODE></A></DL></DD></DL><HR><A NAME="adapt(org.apache.commons.pool.KeyedPoolableObjectFactory, java.lang.Object)"><!-- --></A><H3>adapt</H3><PRE>public static <A HREF="../../../../org/apache/commons/pool/PoolableObjectFactory.html" title="interface in org.apache.commons.pool">PoolableObjectFactory</A> <B>adapt</B>(<A HREF="../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool">KeyedPoolableObjectFactory</A> keyedFactory, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> key) throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></PRE><DL><DD>Adapt a <code>KeyedPoolableObjectFactory</code> instance to work where a <code>PoolableObjectFactory</code> is needed using the specified <code>key</code> when delegating.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>keyedFactory</CODE> - the <A HREF="../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool"><CODE>KeyedPoolableObjectFactory</CODE></A> to delegate to.<DD><CODE>key</CODE> - the key to use when delegating.<DT><B>Returns:</B><DD>a <A HREF="../../../../org/apache/commons/pool/PoolableObjectFactory.html" title="interface in org.apache.commons.pool"><CODE>PoolableObjectFactory</CODE></A> that delegates to <code>keyedFactory</code> with the specified key.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - when <code>keyedFactory</code> or <code>key</code> is <code>null</code>.<DT><B>Since:</B></DT> <DD>Pool 1.3</DD><DT><B>See Also:</B><DD><A HREF="../../../../org/apache/commons/pool/PoolUtils.html#adapt(org.apache.commons.pool.KeyedPoolableObjectFactory)"><CODE>adapt(KeyedPoolableObjectFactory)</CODE></A></DL></DD></DL><HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -