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

📄 stackkeyedobjectpool.html

📁 优秀的文档,可以学习java之用 0006728337 00000 n 0006728424 00000 n 0006728600 00000 n
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<A NAME="_totActive"><!-- --></A><H3>_totActive</H3><PRE>protected int <B>_totActive</B></PRE><DL><DD>Total number of object borrowed and not yet retuened for all pools<P><DL></DL></DL><HR><A NAME="_totIdle"><!-- --></A><H3>_totIdle</H3><PRE>protected int <B>_totIdle</B></PRE><DL><DD>Total number of objects "sleeping" for all pools<P><DL></DL></DL><HR><A NAME="_activeCount"><!-- --></A><H3>_activeCount</H3><PRE>protected <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/HashMap.html" title="class or interface in java.util">HashMap</A> <B>_activeCount</B></PRE><DL><DD>Number of active objects borrowed and not yet returned by pool<P><DL></DL></DL><!-- ========= 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="StackKeyedObjectPool()"><!-- --></A><H3>StackKeyedObjectPool</H3><PRE>public <B>StackKeyedObjectPool</B>()</PRE><DL><DD>Create a new pool using no factory. Clients must first populate the pool using <A HREF="../../../../../org/apache/commons/pool/impl/StackKeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)"><CODE>returnObject(java.lang.Object,java.lang.Object)</CODE></A> before they can be <A HREF="../../../../../org/apache/commons/pool/impl/StackKeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowed</CODE></A>.<P></DL><HR><A NAME="StackKeyedObjectPool(int)"><!-- --></A><H3>StackKeyedObjectPool</H3><PRE>public <B>StackKeyedObjectPool</B>(int&nbsp;max)</PRE><DL><DD>Create a new pool using no factory. Clients must first populate the pool using <A HREF="../../../../../org/apache/commons/pool/impl/StackKeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)"><CODE>returnObject(java.lang.Object,java.lang.Object)</CODE></A> before they can be <A HREF="../../../../../org/apache/commons/pool/impl/StackKeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowed</CODE></A>.<P><DL><DT><B>Parameters:</B><DD><CODE>max</CODE> - cap on the number of "sleeping" instances in the pool</DL></DL><HR><A NAME="StackKeyedObjectPool(int, int)"><!-- --></A><H3>StackKeyedObjectPool</H3><PRE>public <B>StackKeyedObjectPool</B>(int&nbsp;max,                            int&nbsp;init)</PRE><DL><DD>Create a new pool using no factory. Clients must first populate the pool using <A HREF="../../../../../org/apache/commons/pool/impl/StackKeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)"><CODE>returnObject(java.lang.Object,java.lang.Object)</CODE></A> before they can be <A HREF="../../../../../org/apache/commons/pool/impl/StackKeyedObjectPool.html#borrowObject(java.lang.Object)"><CODE>borrowed</CODE></A>.<P><DL><DT><B>Parameters:</B><DD><CODE>max</CODE> - cap on the number of "sleeping" instances in the pool<DD><CODE>init</CODE> - initial size of the pool (this specifies the size of the container,             it does not cause the pool to be pre-populated.)</DL></DL><HR><A NAME="StackKeyedObjectPool(org.apache.commons.pool.KeyedPoolableObjectFactory)"><!-- --></A><H3>StackKeyedObjectPool</H3><PRE>public <B>StackKeyedObjectPool</B>(<A HREF="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool">KeyedPoolableObjectFactory</A>&nbsp;factory)</PRE><DL><DD>Create a new <tt>SimpleKeyedObjectPool</tt> using the specified <i>factory</i> to create new instances.<P><DL><DT><B>Parameters:</B><DD><CODE>factory</CODE> - the <A HREF="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool"><CODE>KeyedPoolableObjectFactory</CODE></A> used to populate the pool</DL></DL><HR><A NAME="StackKeyedObjectPool(org.apache.commons.pool.KeyedPoolableObjectFactory, int)"><!-- --></A><H3>StackKeyedObjectPool</H3><PRE>public <B>StackKeyedObjectPool</B>(<A HREF="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool">KeyedPoolableObjectFactory</A>&nbsp;factory,                            int&nbsp;max)</PRE><DL><DD>Create a new <tt>SimpleKeyedObjectPool</tt> using the specified <i>factory</i> to create new instances. capping the number of "sleeping" instances to <i>max</i><P><DL><DT><B>Parameters:</B><DD><CODE>factory</CODE> - the <A HREF="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool"><CODE>KeyedPoolableObjectFactory</CODE></A> used to populate the pool<DD><CODE>max</CODE> - cap on the number of "sleeping" instances in the pool</DL></DL><HR><A NAME="StackKeyedObjectPool(org.apache.commons.pool.KeyedPoolableObjectFactory, int, int)"><!-- --></A><H3>StackKeyedObjectPool</H3><PRE>public <B>StackKeyedObjectPool</B>(<A HREF="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool">KeyedPoolableObjectFactory</A>&nbsp;factory,                            int&nbsp;max,                            int&nbsp;init)</PRE><DL><DD>Create a new <tt>SimpleKeyedObjectPool</tt> using the specified <i>factory</i> to create new instances. capping the number of "sleeping" instances to <i>max</i>, and initially allocating a container capable of containing at least <i>init</i> instances.<P><DL><DT><B>Parameters:</B><DD><CODE>factory</CODE> - the <A HREF="../../../../../org/apache/commons/pool/KeyedPoolableObjectFactory.html" title="interface in org.apache.commons.pool"><CODE>KeyedPoolableObjectFactory</CODE></A> used to populate the pool<DD><CODE>max</CODE> - cap on the number of "sleeping" instances in the pool<DD><CODE>init</CODE> - initial size of the pool (this specifies the size of the container,             it does not cause the pool to be pre-populated.)</DL></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="borrowObject(java.lang.Object)"><!-- --></A><H3>borrowObject</H3><PRE>public <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><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html#borrowObject(java.lang.Object)">KeyedObjectPool</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html#borrowObject(java.lang.Object)">borrowObject</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/pool/BaseKeyedObjectPool.html#borrowObject(java.lang.Object)">borrowObject</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/pool/BaseKeyedObjectPool.html" title="class in org.apache.commons.pool">BaseKeyedObjectPool</A></CODE></DL></DD><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>public 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><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)">KeyedObjectPool</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)">returnObject</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/pool/BaseKeyedObjectPool.html#returnObject(java.lang.Object, java.lang.Object)">returnObject</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/pool/BaseKeyedObjectPool.html" title="class in org.apache.commons.pool">BaseKeyedObjectPool</A></CODE></DL></DD><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>public 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><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html#invalidateObject(java.lang.Object, java.lang.Object)">KeyedObjectPool</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html#invalidateObject(java.lang.Object, java.lang.Object)">invalidateObject</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/pool/KeyedObjectPool.html" title="interface in org.apache.commons.pool">KeyedObjectPool</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/pool/BaseKeyedObjectPool.html#invalidateObject(java.lang.Object, java.lang.Object)">invalidateObject</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/pool/BaseKeyedObjectPool.html" title="class in org.apache.commons.pool">BaseKeyedObjectPool</A></CODE></DL></DD><DD><DL><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>public 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>

⌨️ 快捷键说明

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