mpoeschl    02/03/13 02:40:29

  Modified:    src/java/org/apache/torque Torque.java
  Log:
  remove duplicated code
  
  Revision  Changes    Path
  1.47      +4 -61     jakarta-turbine-torque/src/java/org/apache/torque/Torque.java
  
  Index: Torque.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/Torque.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- Torque.java       13 Mar 2002 10:33:50 -0000      1.46
  +++ Torque.java       13 Mar 2002 10:40:29 -0000      1.47
  @@ -90,7 +90,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rafal Krzewski</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Martin Poeschl</a>
  - * @version $Id: Torque.java,v 1.46 2002/03/13 10:33:50 mpoeschl Exp $
  + * @version $Id: Torque.java,v 1.47 2002/03/13 10:40:29 mpoeschl Exp $
    */
   public class Torque implements Initializable, Configurable
   {
  @@ -178,8 +178,6 @@
        */
       public void initialize() throws TorqueException
       {
  -        // FIX ME!!
  -        // duplicated code init(Configuration)
           if (configuration == null)
           {
               throw new TorqueException("Torque cannot be initialized without " +
  @@ -281,64 +279,9 @@
       public static void init(Configuration c)
           throws TorqueException
       {
  -        Torque.setConfiguration(c);
  -        if (configuration == null)
  -        {
  -            throw new TorqueException("Torque cannot be initialized without " +
  -                "a valid configuration. Please check the log files " +
  -                    "for further details.");
  -        }
  -
  -        // Setup log4j, I suppose we might want to deal with
  -        // systems other than log4j ...
  -        configureLogging();
  -
  -        // Now that we have dealt with processing the log4j properties
  -        // that may be contained in the configuration we will make the
  -        // configuration consist only of the remain torque specific
  -        // properties that are contained in the configuration. First
  -        // look for properties that are in the "torque" namespace.
  -        Configuration originalConf = configuration;
  -        configuration = configuration.subset("torque");
  -
  -        if (configuration == null || configuration.isEmpty())
  -        {
  -            // If there are no properties in the "torque" namespace
  -            // than try the "services.DatabaseService" namespace. This
  -            // will soon be deprecated.
  -            configuration = originalConf.subset("services.DatabaseService");
  -
  -            // the configuration may already have any prefixes stripped
  -            if (configuration == null || configuration.isEmpty())
  -            {
  -                configuration = originalConf;
  -            }
  -        }
  -
  -        dbMaps = new HashMap();
  -        pools = new HashMap();
  -        DBFactory.init(configuration);
  -
  -        isInit = true;
  -        for (Iterator i = mapBuilders.iterator(); i.hasNext(); )
  -        {
  -            //this will add any maps in this builder to the proper database map
  -            BasePeer.getMapBuilder((String)i.next());
  -        }
  -        // any further mapBuilders will be called/built on demand
  -        mapBuilders = null;
  -
  -        // setup manager mappings
  -        initManagerMappings(configuration);
  -
  -        // Create monitor thread
  -        monitor = new Monitor();
  -        // Indicate that this is a system thread. JVM will quit only when there
  -        // are no more active user threads. Settings threads spawned internally
  -        // by Turbine as daemons allows commandline applications using Turbine
  -        // to terminate in an orderly manner.
  -        monitor.setDaemon(true);
  -        monitor.start();
  +        Torque torque = new Torque();
  +        torque.configure(c);
  +        torque.initialize();
       }
   
   
  
  
  

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

Reply via email to