commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcna...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jdbc2pool/src/java/org/apache/commons/jdbc2pool ConnectionPool.java TorqueClassicDataSource.java
Date Sun, 19 May 2002 23:22:54 GMT
jmcnally    02/05/19 16:22:54

  Modified:    jdbc2pool build.xml default.properties
               jdbc2pool/src/java/org/apache/commons/jdbc2pool
                        ConnectionPool.java TorqueClassicDataSource.java
  Log:
  remove log4j dependency and set the default log writer to standard out.
  
  Revision  Changes    Path
  1.5       +1 -19     jakarta-commons-sandbox/jdbc2pool/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jdbc2pool/build.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- build.xml	18 Mar 2002 06:40:49 -0000	1.4
  +++ build.xml	19 May 2002 23:22:54 -0000	1.5
  @@ -12,7 +12,6 @@
     <!-- Construct compile classpath -->
     <path id="classpath">
       <pathelement location="${jdbc.jar}"/>
  -    <pathelement location="${log4j.jar}"/>
       <pathelement location="${commons-lang.jar}"/>
       <pathelement location="${commons-collections.jar}"/>
       <pathelement location="${commons-pool.jar}"/>
  @@ -28,7 +27,6 @@
       <echo message="java.home = ${java.home}"/>
       <echo message="user.home = ${user.home}"/>
       <echo message="lib.repo = ${lib.repo}"/>
  -    <echo message="log4j.jar = ${log4j.jar}"/>
       <echo message="jdbc.jar = ${jdbc.jar}"/>
       <echo message="junit.jar = ${junit.jar}"/>
       <echo message="commons-lang.jar = ${commons-lang.jar}"/>
  @@ -56,12 +54,6 @@
       name="init">
   
       <available
  -      classname="org.apache.log4j.Category"
  -      property="log4j.present"
  -      classpathref="classpath"
  -    />
  -
  -    <available
         classname="org.apache.commons.lang.Objects"
         property="commons-lang.present"
         classpathref="classpath"
  @@ -91,16 +83,6 @@
     <!-- ================================================================== -->
   
     <target
  -    name="check.log4j"
  -    unless="log4j.present">
  -
  -    <antcall target="property-warning">
  -      <param name="name" value="log4j.jar"/>
  -      <param name="value" value="${log4j.jar}"/>
  -    </antcall>
  -  </target>
  -
  -  <target
       name="check.commons-lang"
       unless="commons-lang.present">
   
  @@ -154,7 +136,7 @@
   
     <target
       name="prepare"
  -    depends="init,check.log4j,check.commons-lang,check.commons-collections,
  +    depends="init,check.commons-lang,check.commons-collections,
                check.jdbc,env">
   
       <mkdir dir="${build.dir}"/>
  
  
  
  1.5       +0 -1      jakarta-commons-sandbox/jdbc2pool/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jdbc2pool/default.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- default.properties	18 Mar 2002 06:40:49 -0000	1.4
  +++ default.properties	19 May 2002 23:22:54 -0000	1.5
  @@ -26,7 +26,6 @@
   # your ${user.home}/build.properties or local build.properties file in
   # order to build Jdbc2pool:
   
  -log4j.jar = ${lib.repo}/log4j-1.1.3.jar
   commons-lang.jar = ${lib.repo}/commons-lang-0.1-dev.jar
   commons-collections.jar = ${lib.repo}/commons-collections.jar
   commons-pool.jar = ${lib.repo}/commons-pool.jar
  
  
  
  1.4       +1 -9      jakarta-commons-sandbox/jdbc2pool/src/java/org/apache/commons/jdbc2pool/ConnectionPool.java
  
  Index: ConnectionPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jdbc2pool/src/java/org/apache/commons/jdbc2pool/ConnectionPool.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ConnectionPool.java	26 Jan 2002 22:18:47 -0000	1.3
  +++ ConnectionPool.java	19 May 2002 23:22:54 -0000	1.4
  @@ -67,8 +67,6 @@
   import javax.sql.ConnectionEvent;
   import javax.sql.ConnectionEventListener;
   
  -import org.apache.log4j.Category;
  -
   /**
    * This class implements a simple connection pooling scheme.  Multiple
    * pools are available through use of the <code>PoolBrokerService</code>.
  @@ -82,7 +80,7 @@
    * @author <a href="mailto:magnus@handtolvur.is">Magnús Þór Torfason</a>
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
  - * @version $Id: ConnectionPool.java,v 1.3 2002/01/26 22:18:47 jmcnally Exp $
  + * @version $Id: ConnectionPool.java,v 1.4 2002/05/19 23:22:54 jmcnally Exp $
    */
   class ConnectionPool
       implements ConnectionEventListener
  @@ -156,7 +154,6 @@
       private Map timeStamps;
   
       private PrintWriter logWriter;
  -    private Category category;
   
       /**
        * Creates a <code>ConnectionPool</code> with the default
  @@ -205,7 +202,6 @@
           }
           this.logInterval = logInterval * 1000;    
           this.logWriter = logWriter;        
  -        this.category = Category.exists(getClass().getName());
    
           // Create monitor thread
           monitor = new Monitor();
  @@ -580,10 +576,6 @@
           if ( logWriter != null ) 
           {
               logWriter.println(s);
  -        }
  -        else if ( category != null ) 
  -        {
  -            category.info(s);
           }
           else 
           {
  
  
  
  1.3       +7 -3      jakarta-commons-sandbox/jdbc2pool/src/java/org/apache/commons/jdbc2pool/TorqueClassicDataSource.java
  
  Index: TorqueClassicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jdbc2pool/src/java/org/apache/commons/jdbc2pool/TorqueClassicDataSource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TorqueClassicDataSource.java	18 Mar 2002 06:51:31 -0000	1.2
  +++ TorqueClassicDataSource.java	19 May 2002 23:22:54 -0000	1.3
  @@ -86,7 +86,7 @@
    * Torque's default connection pool DataSource
    *
    * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
  - * @version $Id: TorqueClassicDataSource.java,v 1.2 2002/03/18 06:51:31 jmcnally Exp $
  + * @version $Id: TorqueClassicDataSource.java,v 1.3 2002/05/19 23:22:54 jmcnally Exp $
    */
   public class TorqueClassicDataSource
       implements DataSource, Referenceable, Serializable, ObjectFactory
  @@ -480,7 +480,7 @@
           
               ConnectionPool pool = new ConnectionPool(cpds, username, password,
                   maxConnections, maxExpiryTime, connectionWaitTimeout, 
  -                logInterval, logWriter);
  +                logInterval, getLogWriter());
   
               // avoid ConcurrentModificationException
               Map newPools = new HashMap(pools);
  @@ -503,6 +503,10 @@
        */
       public PrintWriter getLogWriter() 
       {
  +        if (logWriter == null) 
  +        {
  +            logWriter = new PrintWriter(System.out);
  +        }        
           return logWriter;
       }
                              
  @@ -516,7 +520,7 @@
       } 
                              
       /**
  -     * Set the log writer for this data source. NOT USED.
  +     * Set the log writer for this data source.
        */
       public void setLogWriter(java.io.PrintWriter out)
       {
  
  
  

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


Mime
View raw message