db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/java/org/apache/torque/dsfactory Jdbc2PoolDataSourceFactory.java TorqueDataSourceFactory.java AbstractDataSourceFactory.java
Date Tue, 19 Aug 2003 18:30:35 GMT
mpoeschl    2003/08/19 11:30:35

  Modified:    src/java/org/apache/torque/dsfactory
                        Jdbc2PoolDataSourceFactory.java
                        TorqueDataSourceFactory.java
                        AbstractDataSourceFactory.java
  Log:
  move initCPDS() from Jdbc2PoolDataSourceFactory and TorqueDataSourceFactory to AbstractDataSourceFactory
  
  Revision  Changes    Path
  1.11      +1 -33     db-torque/src/java/org/apache/torque/dsfactory/Jdbc2PoolDataSourceFactory.java
  
  Index: Jdbc2PoolDataSourceFactory.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/dsfactory/Jdbc2PoolDataSourceFactory.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Jdbc2PoolDataSourceFactory.java	24 Jul 2003 10:37:58 -0000	1.10
  +++ Jdbc2PoolDataSourceFactory.java	19 Aug 2003 18:30:34 -0000	1.11
  @@ -59,7 +59,6 @@
   
   import org.apache.commons.configuration.Configuration;
   
  -import org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS;
   import org.apache.commons.dbcp.jdbc2pool.Jdbc2PoolDataSource;
   
   import org.apache.commons.logging.Log;
  @@ -111,37 +110,6 @@
           Jdbc2PoolDataSource ds = initJdbc2Pool(configuration);
           ds.setConnectionPoolDataSource(cpds);
           this.ds = ds;
  -    }
  -
  -    /**
  -     * Initializes the ConnectionPoolDataSource.
  -     *
  -     * @param configuration where to read the settings from
  -     * @throws TorqueException if a property set fails
  -     * @return a configured <code>ConnectionPoolDataSource</code>
  -     */
  -    private ConnectionPoolDataSource initCPDS(Configuration configuration)
  -        throws TorqueException
  -    {
  -        log.debug("Starting initCPDS");
  -        ConnectionPoolDataSource cpds = new DriverAdapterCPDS();
  -        Configuration c = Torque.getConfiguration();
  -
  -        if (c == null)
  -        {
  -            log.warn("Global Configuration not set,"
  -                    + " no Default connection pool data source configured!");
  -        }
  -        else
  -        {
  -            Configuration conf = c.subset(DEFAULT_CONNECTION_KEY);
  -            applyConfiguration(conf, cpds);
  -        }
  -            
  -        Configuration conf = configuration.subset(CONNECTION_KEY);
  -        applyConfiguration(conf, cpds);
  -        
  -        return cpds;
       }
   
       /**
  
  
  
  1.13      +1 -25     db-torque/src/java/org/apache/torque/dsfactory/TorqueDataSourceFactory.java
  
  Index: TorqueDataSourceFactory.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/dsfactory/TorqueDataSourceFactory.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TorqueDataSourceFactory.java	18 Aug 2003 21:48:11 -0000	1.12
  +++ TorqueDataSourceFactory.java	19 Aug 2003 18:30:34 -0000	1.13
  @@ -59,8 +59,6 @@
   
   import org.apache.commons.configuration.Configuration;
   
  -import org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS;
  -
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -111,28 +109,6 @@
           TorqueClassicDataSource tcds = initTorqueClassic(configuration);
           tcds.setConnectionPoolDataSource(cpds);
           ds = tcds;
  -    }
  -
  -    /**
  -     * Initializes the ConnectionPoolDataSource.
  -     *
  -     * @param configuration where to read the settings from
  -     * @throws TorqueException if a property set fails
  -     * @return a configured <code>ConnectionPoolDataSource</code>
  -     */
  -    protected ConnectionPoolDataSource initCPDS(Configuration configuration)
  -        throws TorqueException
  -    {
  -        log.debug("Starting initCPDS");
  -        ConnectionPoolDataSource cpds = new DriverAdapterCPDS();
  -        Configuration c = null;
  -
  -        c = Torque.getConfiguration().subset(DEFAULT_CONNECTION_KEY);
  -        applyConfiguration(c, cpds);
  -
  -        c = configuration.subset(CONNECTION_KEY);
  -        applyConfiguration(c, cpds);
  -        return cpds;
       }
   
       /**
  
  
  
  1.12      +37 -4     db-torque/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
  
  Index: AbstractDataSourceFactory.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractDataSourceFactory.java	20 Jun 2003 00:13:04 -0000	1.11
  +++ AbstractDataSourceFactory.java	19 Aug 2003 18:30:34 -0000	1.12
  @@ -56,15 +56,19 @@
   
   import java.util.Iterator;
   
  +import javax.sql.ConnectionPoolDataSource;
  +
   import org.apache.commons.beanutils.ConvertUtils;
   import org.apache.commons.beanutils.MappedPropertyDescriptor;
   import org.apache.commons.beanutils.PropertyUtils;
   
   import org.apache.commons.configuration.Configuration;
  +import org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  +import org.apache.torque.Torque;
   import org.apache.torque.TorqueException;
   
   /**
  @@ -89,9 +93,7 @@
       /** "default.connection" Key for the configuration */
       public static final String DEFAULT_CONNECTION_KEY = "defaults.connection";
   
  -    /**
  -     * The logging logger.
  -     */
  +    /** The log */
       private static Log log = LogFactory.getLog(AbstractDataSourceFactory.class);
   
       /**
  @@ -200,5 +202,36 @@
                   throw new TorqueException(e);
               }
           }
  +    }
  +    
  +    /**
  +     * Initializes the ConnectionPoolDataSource.
  +     *
  +     * @param configuration where to read the settings from
  +     * @throws TorqueException if a property set fails
  +     * @return a configured <code>ConnectionPoolDataSource</code>
  +     */
  +    protected ConnectionPoolDataSource initCPDS(Configuration configuration)
  +        throws TorqueException
  +    {
  +        log.debug("Starting initCPDS");
  +        ConnectionPoolDataSource cpds = new DriverAdapterCPDS();
  +        Configuration c = Torque.getConfiguration();
  +
  +        if (c == null)
  +        {
  +            log.warn("Global Configuration not set,"
  +                    + " no Default connection pool data source configured!");
  +        }
  +        else
  +        {
  +            Configuration conf = c.subset(DEFAULT_CONNECTION_KEY);
  +            applyConfiguration(conf, cpds);
  +        }
  +            
  +        Configuration conf = configuration.subset(CONNECTION_KEY);
  +        applyConfiguration(conf, cpds);
  +        
  +        return cpds;
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message