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

📄 package-summary.html

📁 turbine教程
💻 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:06 CET 2002 --><TITLE>jakarta-turbine-2 2.2 API: Package org.apache.turbine.services</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>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../org/apache/turbine/om/security/peer/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;&nbsp;<A HREF="../../../../org/apache/turbine/services/assemblerbroker/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><H2>Package org.apache.turbine.services</H2>Contains the Service framework for Turbine.<P><B>See: </B><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A><P><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Interface Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="Initable.html"><I>Initable</I></A></B></TD><TD>Classes that implement this interface need initialization before they can work.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="InitableBroker.html"><I>InitableBroker</I></A></B></TD><TD>Classes that implement this interface can act as a broker for <code>Initable</code> classes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="Service.html"><I>Service</I></A></B></TD><TD><code>Services</code> are <code>Initables</code> that have a name, and a set of properties.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="ServiceBroker.html"><I>ServiceBroker</I></A></B></TD><TD>Classes that implement this interface can act as a broker for <code>Service</code> classes.</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Class Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="BaseInitable.html">BaseInitable</A></B></TD><TD>This class provides a generic implementation of <code>Initable</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="BaseInitableBroker.html">BaseInitableBroker</A></B></TD><TD>A generic implementation of <code>InitableBroker</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="BaseService.html">BaseService</A></B></TD><TD>This class is a generic implementation of <code>Service</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="BaseServiceBroker.html">BaseServiceBroker</A></B></TD><TD>A generic implementation of a <code>ServiceBroker</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="BaseUnicastRemoteService.html">BaseUnicastRemoteService</A></B></TD><TD>A base implementation of an <CODE>UnicastRemoteObject</CODE> as a Turbine <A HREF="../../../../org/apache/turbine/services/Service.html"><CODE>Service</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="TurbineBaseService.html">TurbineBaseService</A></B></TD><TD>This class provides a <code>Service</code> implementation that Services used in Turbine are required to extend.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="TurbineServices.html">TurbineServices</A></B></TD><TD>This is a singleton utility class that acts as a Services broker.</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Exception Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="InitializationException.html">InitializationException</A></B></TD><TD>Thrown by <code>Initable</code> class in case of initialization problems.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="InstantiationException.html">InstantiationException</A></B></TD><TD>Thrown by <code>InitableBroker</code> and <code>ServiceBroker</code> classes to indicate problems with instatiation of requested objects.</TD></TR></TABLE>&nbsp;<P><A NAME="package_description"><!-- --></A><H2>Package org.apache.turbine.services Description</H2><P>Contains the Service framework for Turbine.<!-- description that appears in API overview and at the top of package overview --><!-- it is terminated by the first '.' in the body part --><p>Services are singletons that have pluggable implementationand can participate in Turbine startup and shutdown.<p><table><tr><td width="100%"><h3>What is a service?</h3><ul><li> Is a singleton -  there is only one instance of it in the system      i.e. memory or connections are allocated once only, and the internal     state is common to all requesting clients.<li> Has pluggable implementation - you can use your own implementation     if you need, just change  an entry in TurbineResources.properties,     and there you go.<li> Can access ServletConfig at system startup time to process     relative paths and the like.<li> Can access RunData on the first Turbine doGet execution to     get URL we're running under and the like.<li> Can initialize itself (allocate memory, make connctions)     just before the client requests it for the first time. Services that     are never used by the application will not allocate resources.<li> Can execute some action upon system shutdown e.g. close the      opened connections.</ul>		  <h3>The life cycle of a Service</h3><p>A Service (or any other Initable, if we had any) is not supposed to do much in it's constructor. Especialy it should not allocateany costly resources like large memory structures, DB or networkconnections and the like. It may well happen that the Serviceis sitting in the config file, but the application does not need it, so allocating all resources at system startup mightbe a loss.<p>Early initialization is similar to the constructor. It is usedto pass some information that the Service will need in it'sfuture operation. For example WebMacro Service uses ServletConfigobject to process it's own configuration options: getRealPath()method is used to convert paths to WebMacro.properties and templates from relative to webapp root to absolute paths.UniqueId Service uses the HttpRequest object from the first Turbineinvocation to determine URL this instance is runnign under, to generate instance ID.Early initialization method should process the configuration, storesome values, but NOT allocate resources. There is still a chancethat the Service will not be used.(Actually WebMacroService does this wrong, because it triggers it's late initializer inside early initializer. This needsto be fixed eventually.)If the Service is ready to work (i.e. does not need any more objectsbeing sent to it), and does not to allocate any resources duringlate initialization, the internal state can be changed so thatgetInit() returns true.<p>Late initialization happens when the Service is requested by theapplication for the first time. It should allocate any resourcesneeded and chnge the state so that getInit() returns true.If getInit() returns false after init() is executed, the Service has malfunctioned.<p>After late initialization, the Service is ready to perform actionson behalf of the application.<p>When the Service is no longer needed (this usually happens when system is shutting down), the shutdown() method is called.shutdown() should deallocate all resources. If any error conditionsoccur they are ignored.<h3>Initialization of services outside of the Turbine servlet</h3><p>In the case where specific Turbine services are desired outside thecontext of the <code>Turbine</code> servlet, a Turbine JAR file can beused in conjunction with a <i>properly configured</i><code>TurbineResources.properties</code> file to initialize a specificset of services to use in your application.  The following samplecode performs such initialization:<p><blockquote><code><pre>String webAppRoot = "/var/httpd/webapps";String trProps = "/var/httpd/TurbineResources.properties";try{    TurbineConfig cfg = new TurbineConfig(webAppRoot, trProps);    cfg.init();}catch (Exception e){    // If Turine fails to initialize, no logging service will be available.    String msg = "Failed to initialize Turbine: " + e.getMessage();    // Write directly to stderr to preserve the full stack trace.    System.err.println(msg);    e.printStackTrace();    throw new Error(msg);}</pre></code></blockquote></td></tr></table><br><font size="-2">$Id: package.html,v 1.1.1.1 2001/08/16 05:08:48 jvanzyl Exp $</font><P><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../org/apache/turbine/om/security/peer/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;&nbsp;<A HREF="../../../../org/apache/turbine/services/assemblerbroker/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR>Copyright &copy; 2000-2002 Apache Software Foundation. All Rights Reserved.</BODY></HTML>

⌨️ 快捷键说明

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