You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by he...@apache.org on 2002/07/24 17:01:34 UTC

cvs commit: jakarta-turbine-2/xdocs/services component-service.xml

henning     2002/07/24 08:01:34

  Modified:    conf     TurbineResources.properties
               src/java/org/apache/turbine Turbine.java
               src/java/org/apache/turbine/services TurbineServices.java
               src/java/org/apache/turbine/util TurbineConfig.java
               xdocs    services.xml
  Added:       src/java/org/apache/turbine/services/component
                        ComponentService.java TurbineComponentService.java
               xdocs/services component-service.xml
  Log:
  Replaced the ComponentLoader.load() stuff in Turbine with a
  ComponentService. This is initialized early in the Turbine Startup and
  provides a defined Startup and Shutdown for Lifecycle Components.
  
  There is documentation in xdocs/services/component-service.xml
  
  Newer Torque and Fulcrum implement the Disposable() interface and can
  be shutdown defined by this service.
  
  Revision  Changes    Path
  1.14      +42 -10    jakarta-turbine-2/conf/TurbineResources.properties
  
  Index: TurbineResources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/conf/TurbineResources.properties,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TurbineResources.properties	16 Jul 2002 15:58:56 -0000	1.13
  +++ TurbineResources.properties	24 Jul 2002 15:01:34 -0000	1.14
  @@ -355,6 +355,7 @@
   # -------------------------------------------------------------------
   services.ResourceService.classname=org.apache.turbine.services.resources.TurbineResourceService
   services.LoggingService.classname=org.apache.turbine.services.logging.TurbineLoggingService
  +services.ComponentService.classname=org.apache.turbine.services.component.TurbineComponentService
   services.FactoryService.classname=org.apache.turbine.services.factory.TurbineFactoryService
   services.PoolService.classname=org.apache.turbine.services.pool.TurbinePoolService
   services.RunDataService.classname=org.apache.turbine.services.rundata.TurbineRunDataService
  @@ -951,21 +952,52 @@
   url.case.folding=lower
   
   # -------------------------------------------------------------------
  -#
  -#  C O M P O N E N T S
  +# 
  +#  C O M P O N E N T   S E R V I C E
   #
   # -------------------------------------------------------------------
   # Components implementing the lifecycle interfaces can be loaded,
   # configured and initialized by Turbine
   # -------------------------------------------------------------------
   
  -component.name = torque
  -component.torque.classname = org.apache.torque.Torque
  -component.torque.config = ${webappRoot}/WEB-INF/conf/Torque.properties
  -
  -component.name = fulcrum
  -component.fulcrum.classname = org.apache.fulcrum.Fulcrum
  -component.fulcrum.config = ${webappRoot}/WEB-INF/conf/Fulcrum.properties
  +#
  +# Here you define the names of the various components to load. These
  +# names are used as identifiers later so you can choose them freely. It
  +# is, however, sensible to use the same names as the component projects
  +# that you want to load.
  +#
  +services.ComponentService.name = torque
  +
  +#
  +# This is the class of the component to be loaded. 
  +#
  +# It must implement the org.apache.stratum.lifecycle.Initializable and
  +# org.apache.stratum.lifecycle.Configurable interface to be loaded.
  +#
  +# It may implement the org.apache.stratum.lifecycle.Disposable interface.
  +# If it does, the Component is disposed at shutdown (Servlet destroy()) time.
  +#
  +services.ComponentService.torque.classname = org.apache.torque.Torque
  +
  +#
  +# This is the path to the Config file of the Component. It is relative
  +# to the Root of the Application (either the Webroot given by the Servlet
  +# Container or the Root given to TurbineConfig at startup time)
  +#
  +services.ComponentService.torque.config = /conf/Torque.properties
  +
  +#
  +# Properties can be given directly to Components. This sets the "foo"
  +# property for torque to "bar".
  +#
  +#services.ComponentService.torque.property.foo = bar
  +
  +#
  +# This is an example of how to load Fulcrum as a component
  +#
  +#services.ComponentService.name = fulcrum			  
  +#services.ComponentService.fulcrum.classname = org.apache.fulcrum.Fulcrum
  +#services.ComponentService.fulcrum.config = /conf/Fulcrum.properties
   
   # -------------------------------------------------------------------
   #
  
  
  
  1.20      +8 -11     jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java
  
  Index: Turbine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Turbine.java	11 Jul 2002 14:28:29 -0000	1.19
  +++ Turbine.java	24 Jul 2002 15:01:34 -0000	1.20
  @@ -61,7 +61,6 @@
   import javax.servlet.http.HttpServlet;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  -import org.apache.stratum.component.ComponentLoader;
   import org.apache.turbine.modules.ActionLoader;
   import org.apache.turbine.modules.PageLoader;
   import org.apache.turbine.services.TurbineServices;
  @@ -106,6 +105,7 @@
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
    * @author <a href="mailto:sean@informage.net">Sean Legassick</a>
    * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
  + * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
    * @version $Id$
    */
   public class Turbine
  @@ -174,16 +174,18 @@
        * This init method will load the default resources from a
        * properties file.
        *
  -     * @param config typical Servlet initialization parameter.
  +     * This method is called by init(ServletConfig config)
  +     *
        * @exception ServletException a servlet exception.
        */
  -    public final void init(ServletConfig config)
  +    public final void init()
           throws ServletException
       {
  -        super.init(config);
  -
           synchronized (this.getClass())
           {
  +            super.init();
  +            ServletConfig config = getServletConfig();
  +
               if (!firstInit)
               {
                   log("Double initializaton of Turbine was attempted!");
  @@ -230,11 +232,6 @@
   
                   // Initialize other services that require early init
                   services.initServices(config, false);
  -
  -                // Initialize components like torque and fulcrum
  -                ComponentLoader loader = new ComponentLoader(
  -                        TurbineResources.getConfiguration());
  -                loader.load();
   
                   log ("Turbine: init() Ready to Rumble!");
               }
  
  
  
  1.8       +26 -5     jakarta-turbine-2/src/java/org/apache/turbine/services/TurbineServices.java
  
  Index: TurbineServices.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/TurbineServices.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TurbineServices.java	23 Jul 2002 00:06:54 -0000	1.7
  +++ TurbineServices.java	24 Jul 2002 15:01:34 -0000	1.8
  @@ -62,6 +62,7 @@
   import javax.servlet.ServletConfig;
   import org.apache.commons.configuration.Configuration;
   import org.apache.commons.lang.StringUtils;
  +import org.apache.turbine.services.component.ComponentService;
   import org.apache.turbine.services.logging.LoggingService;
   import org.apache.turbine.services.resources.ResourceService;
   import org.apache.turbine.services.resources.TurbineResources;
  @@ -75,6 +76,7 @@
    * @author <a href="mailto:burton@apache.org">Kevin Burton</a>
    * @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
  + * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
    * @version $Id$
    */
   public class TurbineServices
  @@ -94,15 +96,25 @@
       public final static String RESOURCES_CLASS_DEFAULT =
           "org.apache.turbine.services.resources.TurbineResourceService";
   
  +    /**
  +     * Servlet initialization parameter name for defining the logging
  +     * service implementation to use.
  +     */
  +    public final static String LOGGING_CLASS_KEY="logging";
  +
       /** Default bootstrap logger implementation */
       public final static String LOGGING_CLASS_DEFAULT =
           "org.apache.turbine.services.logging.TurbineLoggingService";
   
       /**
  -     * Servlet initialization parameter name for defining the logging
  -     * service implementation to use.
  +     * Servlet initialization parameter name for defining the component loader
  +     * service implementation to load Stratum based components.
        */
  -    public final static String LOGGING_CLASS_KEY="logging";
  +    public final static String COMPONENT_CLASS_KEY = "component";
  +
  +    /** Default component service implementation */
  +    public final static String COMPONENT_CLASS_DEFAULT =
  +        "org.apache.turbine.services.component.TurbineComponentService";
   
       /**
        * Servlet initialization parameter name for the path to
  @@ -180,7 +192,7 @@
               mapping.setProperty(ResourceService.SERVICE_NAME, resourcesClass);
               initService(ResourceService.SERVICE_NAME, config);
   
  -            // Now logging can be initialized
  +            // Now logging can be initialized.
               String loggingClass = config.getInitParameter(LOGGING_CLASS_KEY);
               if (loggingClass == null)
               {
  @@ -202,6 +214,15 @@
                   mapping.clearProperty(LoggingService.SERVICE_NAME);
                   throw e;
               }
  +
  +            // Now the Component Service can be initialized
  +            // Just set up the mapping and let Turbine call us early.
  +            String componentClass = config.getInitParameter(COMPONENT_CLASS_KEY);
  +            if (componentClass == null)
  +            {
  +                componentClass = COMPONENT_CLASS_DEFAULT;
  +            }
  +            mapping.setProperty(ComponentService.SERVICE_NAME, componentClass);
           }
           finally
           {
  
  
  
  1.1                  jakarta-turbine-2/src/java/org/apache/turbine/services/component/ComponentService.java
  
  Index: ComponentService.java
  ===================================================================
  package org.apache.turbine.services.component;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Turbine" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import org.apache.turbine.services.Service;
  
  /**
   * This service loads components that can be loaded by the Stratum
   * component loader, e.g. the decoupled Torque.
  
   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
   * @version $Id: ComponentService.java,v 1.1 2002/07/24 15:01:34 henning Exp $
   */
  public interface ComponentService 
      extends Service
  {
      /** The publically visible name of the service */
      public String SERVICE_NAME = "ComponentService";
  
  }
  
  
  
  1.1                  jakarta-turbine-2/src/java/org/apache/turbine/services/component/TurbineComponentService.java
  
  Index: TurbineComponentService.java
  ===================================================================
  package org.apache.turbine.services.component;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and 
   *    "Apache Turbine" must not be used to endorse or promote products 
   *    derived from this software without prior written permission. For 
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without 
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import java.util.Iterator;
  import java.util.Properties;
  
  import javax.servlet.ServletConfig;
  
  import org.apache.turbine.services.InitializationException;
  import org.apache.turbine.services.TurbineBaseService;
  
  import org.apache.turbine.services.resources.TurbineResources;
  
  import org.apache.turbine.TurbineConstants;
  
  import org.apache.turbine.util.Log;
  
  import org.apache.commons.configuration.BaseConfiguration;
  import org.apache.commons.configuration.Configuration;
  
  import org.apache.stratum.component.ComponentLoader;
  
  import org.apache.stratum.lifecycle.Disposable;
  
  /**
   * An implementation of ComponentService which loads all the 
   * components given in the TurbineResources.properties File
   *
   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
   * @version $Id: TurbineComponentService.java,v 1.1 2002/07/24 15:01:34 henning Exp $
   */
  
  
  public class TurbineComponentService 
      extends TurbineBaseService
      implements ComponentService
  {
  
      /** Extension used for Configuration files. */
      private static String CONFIG    = "config";
  
      /** Name tag used in Configurations */
      private static String NAME           = "name";
  
      /** Prefix used by the Component Loader */
      private static String COMPONENT      = "component";
  
      /** List of Components that was initialized */
      private Object [] components = null;
  
      /**
       * Load all configured components and initialize them. Throw an
       * InitializationException if anything goes wrong.
       *
       * @param config The servlet config
       *
       * @throws InitializationException Something went wrong in the init
       *         stage
       */ 
  
      /**
       * Inits the service using servlet parameters to obtain path to the
       * configuration file. Change relatives paths.
       */
      public void init(ServletConfig config) 
          throws InitializationException
      {
  
          String webAppRoot = config.getServletContext().getRealPath("");
          
          webAppRoot += System.getProperty("file.separator");
  
          Configuration loaderConf = new BaseConfiguration();
  
          String [] names = getConfiguration().getStringArray(NAME);
          
          for (int i = 0; i < names.length; i++)
          {
              String key = names[i];
  
              loaderConf.addProperty(COMPONENT + "." + NAME, key);
  
              String subProperty = COMPONENT + "." + key;
              Configuration subConf = getConfiguration().subset(key);
  
              for (Iterator it = subConf.getKeys(); it.hasNext(); )
              {
                  String subKey = (String) it.next();
                  Object subVal = subConf.getProperty(subKey);
  
                  if(subKey.equals(CONFIG))
                  {
                      subVal = webAppRoot + (String)subVal;
                  }
                  
                  loaderConf.addProperty(subProperty + "." + subKey,
                                         subVal);
              }
  
              Log.info("Added " + key + " as a component");
          }
  
          try
          {
              ComponentLoader cl = new ComponentLoader(loaderConf);
              components = cl.load();
              setInit(true);
          }
          catch (Exception e)
          {
              Log.error("Component Service failed: ",e);
              throw new InitializationException("ComponentService failed: ",e);
          }
      }
  
      /**
       * Shuts the Component Service down, calls dispose on the components that
       * implement this interface
       *
       */
      
      public void shutdown()
      {
          if(components != null)
          {
              for(int i = 0; i < components.length; i++)
              {
                  if (components[i] instanceof Disposable)
                  {
                      Log.debug("Disposing a "+ components[i].getClass().getName()+" object");
                      ((Disposable)components[i]).dispose();
                  }
                  else
                  {
                      Log.debug("Not disposing " + components[i].getClass().getName() + ", not a Disposable Object");
                  }
              }
          }
          setInit(false);
      }
  }
  
  
  
  1.3       +34 -2     jakarta-turbine-2/src/java/org/apache/turbine/util/TurbineConfig.java
  
  Index: TurbineConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/util/TurbineConfig.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TurbineConfig.java	11 Jul 2002 16:53:21 -0000	1.2
  +++ TurbineConfig.java	24 Jul 2002 15:01:34 -0000	1.3
  @@ -70,6 +70,8 @@
   import javax.servlet.Servlet;
   import javax.servlet.ServletConfig;
   import javax.servlet.ServletContext;
  +import org.apache.stratum.lifecycle.Initializable;
  +import org.apache.stratum.lifecycle.Disposable;
   import org.apache.turbine.Turbine;
   import org.apache.turbine.services.TurbineServices;
   
  @@ -98,9 +100,14 @@
    * @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
  + * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
    * @version $Id$
    */
  -public class TurbineConfig implements ServletConfig, ServletContext
  +public class TurbineConfig
  +    implements ServletConfig,
  +               ServletContext,
  +               Initializable,
  +               Disposable
   {
       /** Enables output of debug messages (compile time option). */
       private final static boolean DEBUG = false;
  @@ -164,9 +171,22 @@
       /**
        * Causes this class to initialize itself which in turn initializes
        * all of the Turbine Services that need to be initialized.
  +     *
  +     * @deprecated Use initialize() instead.
        */
       public void init()
       {
  +        initialize();
  +    }
  +
  +    /**
  +     * Causes this class to initialize itself which in turn initializes
  +     * all of the Turbine Services that need to be initialized.
  +     *
  +     * @see org.apache.stratum.lifecycle.Initializable
  +     */
  +    public void initialize()
  +    {
           try
           {
               turbine = new Turbine();
  @@ -186,6 +206,18 @@
           if (turbine != null)
           {
               turbine.init(data);
  +        }
  +    }
  +
  +    /**
  +     * Shutdown the Turbine System, lifecycle style
  +     *
  +     */
  +    public void dispose()
  +    {
  +        if(turbine != null)
  +        {
  +            turbine.destroy();
           }
       }
   
  
  
  
  1.2       +6 -0      jakarta-turbine-2/xdocs/services.xml
  
  Index: services.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/xdocs/services.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- services.xml	16 Aug 2001 05:10:09 -0000	1.1
  +++ services.xml	24 Jul 2002 15:01:34 -0000	1.2
  @@ -68,6 +68,12 @@
   </li>
   
   <li>
  +<a href="services/component-service.html">Component Service</a> 
  +<br/>
  +Initializes external components which implement the lifecycle interface, e.g. Torque und Fulcrum.
  +</li>
  +
  +<li>
   <a href="services/db-service.html">DB Service</a> 
   <br/>
   <b>[TO DO (PoolBrokerService)]</b> Is a common front end to all database systems. 
  
  
  
  1.1                  jakarta-turbine-2/xdocs/services/component-service.xml
  
  Index: component-service.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <document>
   <properties>
    <title>Turbine Services - Component Service</title>
    <author email="hps@intermeta.de">Henning P. Schmiedehausen</author>
   </properties>
  
  <body>
  
  <section name="Component Service">
  <p>
  The Component service loads external modules which implement the
  org.apache.stratum.lifecycle Interfaces for use with Turbine 2.
  </p>
  <p>
  Main usage for this are the <a
  href="http://jakarta.apache.org/turbine/torque/">Torque</a> and <a
  href="http://jakarta.apache.org/turbine/fulcrum/">Fulcrum</a>
  components of the <a
  hef="http://jakarta.apache.org/turbine/">Turbine</a> project.
  </p>
  
  <p>
  As Turbine-2 now uses the decoupled Torque, you must initialize Torque
  at startup. Fulcrum is currently not integrated in Turbine-2.2 but you
  can use some services from it.
  </p>
  
  </section>
  
  <section name="Configuration">
  
  <source><![CDATA[
  # -------------------------------------------------------------------
  # 
  #  S E R V I C E S
  #
  # -------------------------------------------------------------------
  # Classes for Turbine Services should be defined here.
  # Format: services.[name].classname=[implementing class]
  #
  # To specify properties of a service use the following syntax:
  # service.[name].[property]=[value]
  
  services.ComponentService.classname=org.apache.turbine.services.component.TurbineComponentService
  .
  .
  .
  # -------------------------------------------------------------------
  # 
  #  C O M P O N E N T   S E R V I C E
  #
  # -------------------------------------------------------------------
  # Components implementing the lifecycle interfaces can be loaded,
  # configured and initialized by Turbine
  # -------------------------------------------------------------------
  
  #
  # Here you define the names of the various components to load. These
  # names are used as identifiers later so you can choose them freely. It
  # is, however, sensible to use the same names as the component projects
  # that you want to load.
  #
  services.ComponentService.name = torque
  
  #
  # This is the class of the component to be loaded. 
  #
  # It must implement the org.apache.stratum.lifecycle.Initializable and
  # org.apache.stratum.lifecycle.Configurable interface to be loaded.
  #
  # It may implement the org.apache.stratum.lifecycle.Disposable interface.
  # If it does, the Component is disposed at shutdown (Servlet destroy()) time.
  #
  services.ComponentService.torque.classname = org.apache.torque.Torque
  
  #
  # This is the path to the Config file of the Component. It is relative
  # to the Root of the Application (either the Webroot given by the Servlet
  # Container or the Root given to TurbineConfig at startup time)
  #
  services.ComponentService.torque.config = /conf/Torque.properties
  
  #
  # Properties can be given directly to Components. This sets the "foo"
  # property for torque to "bar".
  #
  services.ComponentService.torque.property.foo = bar
  
  # This is an example of how to load Fulcrum as a component
  #
  #
  services.ComponentService.name = fulcrum			  
  services.ComponentService.fulcrum.classname = org.apache.fulcrum.Fulcrum
  services.ComponentService.fulcrum.config = /conf/Fulcrum.properties
  
  ]]></source>
  
  </section>
  
  <section name="Usage">
  
  <p>
  If you plan to use the decoupled Torque in your application, you should
  leave the Component Service configured at all times. It is started at
  early startup time. Once it has initialized all the components, there
  are no application specific methods or services available.
  </p>
  </section>
  
  </body>
  
  </document>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>