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

📄 keyedobjectpool.html

📁 优秀的文档,可以学习java之用 0006728337 00000 n 0006728424 00000 n 0006728600 00000 n
💻 HTML
📖 第 1 页 / 共 3 页
字号:
 current borrowed from my pool but not yet returned (optional operation).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#getNumActive(java.lang.Object)">getNumActive</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of instances currently borrowed from but not yet returned to my pool corresponding to the given <i>key</i> (optional operation).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#getNumIdle()">getNumIdle</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the total number of instances currently idle in my pool (optional operation).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#getNumIdle(java.lang.Object)">getNumIdle</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of instances corresponding to the given <i>key</i> currently idle in my pool (optional operation).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#invalidateObject(java.lang.Object, java.lang.Object)">invalidateObject</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key,                 <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;obj)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Invalidates an object from the pool By contract, <i>obj</i> MUST have been obtained using <A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowObject</CODE></A> or a related method as defined in an implementation or sub-interface  using a <i>key</i> that is equivalent to the one used to borrow the <tt>Object</tt> in the first place.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)">returnObject</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key,             <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;obj)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return an instance to my pool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#setFactory(org.apache.commons.pool.KeyedPoolableObjectFactory)">setFactory</A></B>(<A HREF="../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool">KeyedPoolableObjectFactory</A>&nbsp;factory)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the <A HREF="../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool"><CODE>factory</CODE></A> I use to create new instances (optional operation).</TD></TR></TABLE>&nbsp;<P><!-- ============ 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="borrowObject(java.lang.Object)"><!-- --></A><H3>borrowObject</H3><PRE><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>borrowObject</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key)                    throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Obtain an instance from my pool for the specified <i>key</i>. By contract, clients MUST return the borrowed object using <A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)"><CODE><tt>returnObject</tt></CODE></A>, or a related method as defined in an implementation or sub-interface, using a <i>key</i> that is equivalent to the one used to borrow the instance in the first place.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the key used to obtain the object<DT><B>Returns:</B><DD>an instance from my pool.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE></DL></DD></DL><HR><A NAME="returnObject(java.lang.Object, java.lang.Object)"><!-- --></A><H3>returnObject</H3><PRE>void <B>returnObject</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key,                  <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;obj)                  throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Return an instance to my pool. By contract, <i>obj</i> MUST have been obtained using <A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE><tt>borrowObject</tt></CODE></A> or a related method as defined in an implementation or sub-interface  using a <i>key</i> that is equivalent to the one used to borrow the <tt>Object</tt> in the first place.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the key used to obtain the object<DD><CODE>obj</CODE> - a <A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowed</CODE></A> instance to be returned.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE></DL></DD></DL><HR><A NAME="invalidateObject(java.lang.Object, java.lang.Object)"><!-- --></A><H3>invalidateObject</H3><PRE>void <B>invalidateObject</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key,                      <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;obj)                      throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Invalidates an object from the pool By contract, <i>obj</i> MUST have been obtained using <A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowObject</CODE></A> or a related method as defined in an implementation or sub-interface  using a <i>key</i> that is equivalent to the one used to borrow the <tt>Object</tt> in the first place. <p> This method should be used when an object that has been borrowed is determined (due to an exception or other problem) to be invalid. If the connection should be validated before or after borrowing, then the <A HREF="../../../../org/apache/commons/pool/PoolableObjectFactory.html#validateObject(java.lang.Object)"><CODE>PoolableObjectFactory.validateObject(java.lang.Object)</CODE></A> method should be used instead.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - a <A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowed</CODE></A> instance to be returned.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE></DL></DD></DL><HR><A NAME="addObject(java.lang.Object)"><!-- --></A><H3>addObject</H3><PRE>void <B>addObject</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key)               throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Create an object using my <A HREF="../../../../org/apache/commons/pool/KeyedObjectPool.html#setFactory(org.apache.commons.pool.KeyedPoolableObjectFactory)"><CODE>factory</CODE></A> or other implementation dependent mechanism, and place it into the pool. addObject() is useful for "pre-loading" a pool with idle objects. (Optional operation).<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE></DL></DD></DL><HR><A NAME="getNumIdle(java.lang.Object)"><!-- --></A><H3>getNumIdle</H3><PRE>int <B>getNumIdle</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key)               throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></PRE><DL><DD>Returns the number of instances corresponding to the given <i>key</i> currently idle in my pool (optional operation). Throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang"><CODE>UnsupportedOperationException</CODE></A> if this information is not available.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the key<DT><B>Returns:</B><DD>the number of instances corresponding to the given <i>key</i> currently idle in my pool<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - when this implementation doesn't support the operation</DL></DD></DL><HR><A NAME="getNumActive(java.lang.Object)"><!-- --></A><H3>getNumActive</H3><PRE>int <B>getNumActive</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;key)

⌨️ 快捷键说明

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