avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource InformixDataSource.java J2eeDataSource.java JdbcConnectionPool.java JdbcDataSource.java
Date Fri, 23 Nov 2001 01:43:24 GMT
colus       01/11/22 17:43:24

  Modified:    src/java/org/apache/avalon/excalibur/datasource
                        InformixDataSource.java J2eeDataSource.java
                        JdbcConnectionPool.java JdbcDataSource.java
  Log:
  LogEnabled with backward compatibility.
  
  Revision  Changes    Path
  1.5       +14 -9     jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource/InformixDataSource.java
  
  Index: InformixDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource/InformixDataSource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InformixDataSource.java	2001/11/19 12:08:47	1.4
  +++ InformixDataSource.java	2001/11/23 01:43:24	1.5
  @@ -7,16 +7,16 @@
    */
   package org.apache.avalon.excalibur.datasource;
   
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.excalibur.datasource.DataSourceComponent;
  -
   import java.sql.Connection;
   import java.sql.SQLException;
   import javax.naming.Context;
   import javax.naming.InitialContext;
  -
  +import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.LogKitLogger;
  +import org.apache.avalon.framework.logger.Loggable;
  +import org.apache.avalon.excalibur.datasource.DataSourceComponent;
   import com.informix.jdbcx.IfxConnectionPoolDataSource;
   import com.informix.jdbcx.IfxDataSource;
   
  @@ -45,12 +45,12 @@
    * DataSource requires the Avalon Cadastre package because it uses the MemoryContext.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.4 $ $Date: 2001/11/19 12:08:47 $
  + * @version CVS $Revision: 1.5 $ $Date: 2001/11/23 01:43:24 $
    * @since 4.0
    */
   public class InformixDataSource
  -    extends AbstractLoggable
  -    implements DataSourceComponent
  +    extends AbstractLogEnabled
  +    implements DataSourceComponent, Loggable
   {
       private IfxDataSource m_dataSource;
       private boolean m_autocommit;
  @@ -68,6 +68,11 @@
               System.setProperty( Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.avalon.excalibur.naming.memory.MemoryInitialContextFactory"
);
           }
  +    }
  +
  +    public void setLogger( final org.apache.log.Logger logger )
  +    {
  +        enableLogging( new LogKitLogger( logger ) );
       }
   
       /**
  
  
  
  1.4       +11 -4     jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource/J2eeDataSource.java
  
  Index: J2eeDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource/J2eeDataSource.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- J2eeDataSource.java	2001/08/07 10:57:07	1.3
  +++ J2eeDataSource.java	2001/11/23 01:43:24	1.4
  @@ -13,7 +13,9 @@
   import javax.naming.InitialContext;
   import javax.naming.NamingException;
   import javax.sql.DataSource;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.Loggable;
  +import org.apache.avalon.framework.logger.LogKitLogger;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   
  @@ -23,15 +25,20 @@
    * J2EE container pools the datasources properly.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2001/08/07 10:57:07 $
  + * @version CVS $Revision: 1.4 $ $Date: 2001/11/23 01:43:24 $
    * @since 4.0
    */
   public class J2eeDataSource
  -    extends AbstractLoggable
  -    implements DataSourceComponent
  +    extends AbstractLogEnabled
  +    implements DataSourceComponent, Loggable
   {
       public static final String  JDBC_NAME     = "java:comp/env/jdbc/";
       protected DataSource        m_dataSource  = null;
  +
  +    public void setLogger( org.apache.log.Logger logger )
  +    {
  +        enableLogging( new LogKitLogger( logger ) );
  +    }
   
       /**
        *  Configure and set up DB connection.  Here we set the connection
  
  
  
  1.11      +3 -2      jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionPool.java
  
  Index: JdbcConnectionPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionPool.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JdbcConnectionPool.java	2001/11/13 16:40:24	1.10
  +++ JdbcConnectionPool.java	2001/11/23 01:43:24	1.11
  @@ -15,14 +15,13 @@
   import org.apache.avalon.excalibur.pool.Poolable;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
   
   /**
    * The Pool implementation for JdbcConnections.  It uses a background
    * thread to manage the number of SQL Connections.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.10 $ $Date: 2001/11/13 16:40:24 $
  + * @version CVS $Revision: 1.11 $ $Date: 2001/11/23 01:43:24 $
    * @since 4.0
    */
   public class JdbcConnectionPool
  @@ -178,11 +177,13 @@
           return obj;
       }
   
  +    /*
       public void put( Poolable obj )
       {
           super.put( obj );
           this.notifyAll();
       }
  +    */
   
       public void run()
       {
  
  
  
  1.12      +12 -6     jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource/JdbcDataSource.java
  
  Index: JdbcDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/datasource/JdbcDataSource.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JdbcDataSource.java	2001/11/02 19:28:35	1.11
  +++ JdbcDataSource.java	2001/11/23 01:43:24	1.12
  @@ -12,8 +12,9 @@
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.LogKitLogger;
  +import org.apache.avalon.framework.logger.Loggable;
   import org.apache.avalon.excalibur.pool.DefaultPoolController;
   
   /**
  @@ -34,15 +35,20 @@
    * </pre>
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.11 $ $Date: 2001/11/02 19:28:35 $
  + * @version CVS $Revision: 1.12 $ $Date: 2001/11/23 01:43:24 $
    * @since 4.0
    */
   public class JdbcDataSource
  -    extends AbstractLoggable
  -    implements DataSourceComponent, Disposable
  +    extends AbstractLogEnabled
  +    implements DataSourceComponent, Disposable, Loggable
   {
       protected JdbcConnectionPool        m_pool;
   
  +    public void setLogger( final org.apache.log.Logger logger )
  +    {
  +        enableLogging( new LogKitLogger( logger ) );
  +    }
  +
       /**
        *  Configure and set up DB connection.  Here we set the connection
        *  information needed to create the Connection objects.  It must
  @@ -156,12 +162,12 @@
                       new JdbcConnectionFactory( dburl, user, passwd, autoCommit, keepAlive,
connectionClass );
               final DefaultPoolController poolController = new DefaultPoolController(l_max
/ 4);
   
  -            factory.enableLogging( new LogKitLogger( getLogger() ) );
  +            factory.enableLogging( getLogger() );
   
               try
               {
                   m_pool = new JdbcConnectionPool( factory, poolController, l_min, l_max,
autoCommit );
  -                m_pool.setLogger( getLogger() );
  +                m_pool.enableLogging( getLogger() );
                   m_pool.setTimeout( timeout );
                   m_pool.initialize();
               }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message