📄 poolservice.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Dec 06 19:57:08 CET 2002 --><TITLE>jakarta-turbine-2 2.2 API: Interface PoolService</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PoolService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="PoolService.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.apache.turbine.services.pool</FONT><BR>Interface PoolService</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../../../../org/apache/turbine/services/factory/FactoryService.html">FactoryService</A>, <A HREF="../../../../../org/apache/turbine/services/Initable.html">Initable</A>, <A HREF="../../../../../org/apache/turbine/services/Service.html">Service</A></DD></DL><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../org/apache/turbine/services/pool/TurbinePoolService.html">TurbinePoolService</A></DD></DL><HR><DL><DT>public interface <B>PoolService</B><DT>extends <A HREF="../../../../../org/apache/turbine/services/factory/FactoryService.html">FactoryService</A></DL><P>The Pool Service extends the Factory Service by adding support for pooling instantiated objects. When a new instance is requested, the service first checks its pool if one is available. If the the pool is empty, a new object will be instantiated from the specified class. If only class name is given, the request to create an intance will be forwarded to the Factory Service. <p>For objects implementing the Recyclable interface, a recycle method will be called, when they are taken from the pool, and a dispose method, when they are returned to the pool.<P><DL><DT><B>Version: </B><DD>$Id: PoolService.java,v 1.1.1.1 2001/08/16 05:09:09 jvanzyl Exp $</DD><DT><B>Author: </B><DD><a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a></DD></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/pool/PoolService.html#DEFAULT_POOL_CAPACITY">DEFAULT_POOL_CAPACITY</A></B></CODE><BR> The default pool capacity.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/pool/PoolService.html#SERVICE_NAME">SERVICE_NAME</A></B></CODE><BR> The key under which this service is stored in TurbineServices.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></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/turbine/services/pool/PoolService.html#clearPool()">clearPool</A></B>()</CODE><BR> Clears all instances from the pool.</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/turbine/services/pool/PoolService.html#clearPool(java.lang.String)">clearPool</A></B>(java.lang.String className)</CODE><BR> Clears instances of a named class from the pool.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/pool/PoolService.html#getCapacity(java.lang.String)">getCapacity</A></B>(java.lang.String className)</CODE><BR> Gets the capacity of the pool for a named class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/pool/PoolService.html#getInstance(java.lang.Class)">getInstance</A></B>(java.lang.Class clazz)</CODE><BR> Gets an instance of a specified class either from the pool or by instatiating from the class if the pool is empty.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/pool/PoolService.html#getInstance(java.lang.Class, java.lang.Object[], java.lang.String[])">getInstance</A></B>(java.lang.Class clazz, java.lang.Object[] params, java.lang.String[] signature)</CODE><BR> Gets an instance of a specified class either from the pool or by instatiating from the class if the pool is empty.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/pool/PoolService.html#getSize(java.lang.String)">getSize</A></B>(java.lang.String className)</CODE><BR> Gets the current size of the pool for a named class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/turbine/services/pool/PoolService.html#putInstance(java.lang.Object)">putInstance</A></B>(java.lang.Object instance)</CODE><BR> Puts a used object back to the pool.</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/turbine/services/pool/PoolService.html#setCapacity(java.lang.String, int)">setCapacity</A></B>(java.lang.String className, int capacity)</CODE><BR> Sets the capacity of the pool for a named class.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_org.apache.turbine.services.factory.FactoryService"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface org.apache.turbine.services.factory.<A HREF="../../../../../org/apache/turbine/services/factory/FactoryService.html">FactoryService</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../../../org/apache/turbine/services/factory/FactoryService.html#getInstance(java.lang.String)">getInstance</A>, <A HREF="../../../../../org/apache/turbine/services/factory/FactoryService.html#getInstance(java.lang.String, java.lang.ClassLoader)">getInstance</A>, <A HREF="../../../../../org/apache/turbine/services/factory/FactoryService.html#getInstance(java.lang.String, java.lang.ClassLoader, java.lang.Object[], java.lang.String[])">getInstance</A>, <A HREF="../../../../../org/apache/turbine/services/factory/FactoryService.html#getInstance(java.lang.String, java.lang.Object[], java.lang.String[])">getInstance</A>, <A HREF="../../../../../org/apache/turbine/services/factory/FactoryService.html#isLoaderSupported(java.lang.String)">isLoaderSupported</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_org.apache.turbine.services.Service"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface org.apache.turbine.services.<A HREF="../../../../../org/apache/turbine/services/Service.html">Service</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../../../org/apache/turbine/services/Service.html#getConfiguration()">getConfiguration</A>, <A HREF="../../../../../org/apache/turbine/services/Service.html#getName()">getName</A>, <A HREF="../../../../../org/apache/turbine/services/Service.html#getProperties()">getProperties</A>, <A HREF="../../../../../org/apache/turbine/services/Service.html#setName(java.lang.String)">setName</A>, <A HREF="../../../../../org/apache/turbine/services/Service.html#setServiceBroker(org.apache.turbine.services.ServiceBroker)">setServiceBroker</A></CODE></TD></TR></TABLE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -