mpoeschl    02/03/13 11:44:19

  Modified:    src/java/org/apache/turbine Turbine.java
               conf/master TurbineResources.master
               conf     TurbineResources.properties
  Log:
  use stratums ComponentLoader
  
  Revision  Changes    Path
  1.11      +6 -48     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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Turbine.java      8 Feb 2002 21:36:29 -0000       1.10
  +++ Turbine.java      13 Mar 2002 19:44:19 -0000      1.11
  @@ -64,6 +64,7 @@
   import javax.servlet.http.HttpServlet;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  +import org.apache.stratum.component.ComponentLoader;
   import org.apache.stratum.configuration.Configuration;
   import org.apache.stratum.configuration.PropertiesConfiguration;
   import org.apache.stratum.lifecycle.Configurable;
  @@ -116,7 +117,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Sean Legassick</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Martin Poeschl</a>
  - * @version $Id: Turbine.java,v 1.10 2002/02/08 21:36:29 brekke Exp $
  + * @version $Id: Turbine.java,v 1.11 2002/03/13 19:44:19 mpoeschl Exp $
    */
   public class Turbine
       extends HttpServlet
  @@ -239,8 +240,10 @@
                   // Initialize other services that require early init
                   services.initServices(config, false);
   
  -                // Initialize subsystems like torque and fulcrum
  -                loadSubsystems();
  +                // Initialize components like torque and fulcrum
  +                ComponentLoader loader = new ComponentLoader(
  +                        TurbineResources.getConfiguration());
  +                loader.load();
   
                   log ("Turbine: init() Ready to Rumble!");
               }
  @@ -824,50 +827,5 @@
       {
           services.notice(message);
           services.error(t);
  -    }
  -
  -    /**
  -     * load subsystems like torque and fulcrum.
  -     */
  -    private void loadSubsystems()
  -    {
  -        // name of the subsystem
  -        String sysName = null;
  -        // name of the class to load
  -        String sysClassName;
  -        // name of the config file used to configure the subsystem
  -        String sysConfig;
  -
  -        // get name of all subsystems to be loaded
  -        Vector systems = TurbineResources.getVector("subsystem.name");
  -
  -        for (int i = 0; i < systems.size(); i++)
  -        {
  -            try
  -            {
  -                sysName = (String) systems.get(i);
  -                sysClassName = TurbineResources.getString("subsystem."
  -                        + sysName + ".classname");
  -                sysConfig = TurbineServlet.getRealPath(
  -                        TurbineResources.getString("subsystem."+ sysName
  -                        + ".config"));
  -
  -                Log.note("loading subsystem " + sysName + " - class: "
  -                        + sysClassName + " with config: " + sysConfig);
  -
  -                Object sys = Class.forName(sysClassName).newInstance();
  -
  -                // configure subsystem using the defined config file
  -                ((Configurable) sys).configure( (Configuration)
  -                        new PropertiesConfiguration(sysConfig));
  -
  -                // initialize subsystem
  -                ((Initializable) sys).initialize();
  -            }
  -            catch (Exception ex)
  -            {
  -                Log.error(StringUtils.makeString(sysName) + " could not be 
initialized!", ex);
  -            }
  -        }
       }
   }
  
  
  
  1.11      +10 -11    jakarta-turbine-2/conf/master/TurbineResources.master
  
  Index: TurbineResources.master
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/conf/master/TurbineResources.master,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TurbineResources.master   13 Mar 2002 13:24:09 -0000      1.10
  +++ TurbineResources.master   13 Mar 2002 19:44:19 -0000      1.11
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: TurbineResources.master,v 1.10 2002/03/13 13:24:09 mpoeschl Exp $
  +# $Id: TurbineResources.master,v 1.11 2002/03/13 19:44:19 mpoeschl Exp $
   #
   # This is the configuration file for Turbine.
   #
  @@ -1008,21 +1008,20 @@
   
   # -------------------------------------------------------------------
   #
  -#  S U B S Y S T E M S
  +#  C O M P O N E N T S
   #
   # -------------------------------------------------------------------
  -# Subsystems implementing the lifecycle interfaces can be loaded,
  +# Components implementing the lifecycle interfaces can be loaded,
   # configured and initialized by Turbine
   # -------------------------------------------------------------------
   
  -subsystem.name = torque
  -subsystem.name = fulcrum
  -
  -subsystem.torque.classname = org.apache.torque.Torque
  -subsystem.torque.config = /WEB-INF/conf/Torque.properties
  -
  -subsystem.fulcrum.classname = org.apache.fulcrum.Fulcrum
  -subsystem.fulcrum.config = /WEB-INF/conf/Fulcrum.properties
  +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
   
   # -------------------------------------------------------------------
   #
  
  
  
  1.11      +10 -11    jakarta-turbine-2/conf/TurbineResources.properties
  
  Index: TurbineResources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/conf/TurbineResources.properties,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TurbineResources.properties       13 Mar 2002 13:24:09 -0000      1.10
  +++ TurbineResources.properties       13 Mar 2002 19:44:19 -0000      1.11
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: TurbineResources.properties,v 1.10 2002/03/13 13:24:09 mpoeschl Exp $
  +# $Id: TurbineResources.properties,v 1.11 2002/03/13 19:44:19 mpoeschl Exp $
   #
   # This is the configuration file for Turbine.
   #
  @@ -1008,21 +1008,20 @@
   
   # -------------------------------------------------------------------
   #
  -#  S U B S Y S T E M S
  +#  C O M P O N E N T S
   #
   # -------------------------------------------------------------------
  -# Subsystems implementing the lifecycle interfaces can be loaded,
  +# Components implementing the lifecycle interfaces can be loaded,
   # configured and initialized by Turbine
   # -------------------------------------------------------------------
   
  -subsystem.name = torque
  -subsystem.name = fulcrum
  -
  -subsystem.torque.classname = org.apache.torque.Torque
  -subsystem.torque.config = /WEB-INF/conf/Torque.properties
  -
  -subsystem.fulcrum.classname = org.apache.fulcrum.Fulcrum
  -subsystem.fulcrum.config = /WEB-INF/conf/Fulcrum.properties
  +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
   
   # -------------------------------------------------------------------
   #
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to