User: starksm 
  Date: 01/11/20 01:42:53

  Modified:    src/main/org/jboss/jdbc Tag: Branch_2_4
                        HypersonicDatabase.java InstantDBDatabase.java
                        JDBCDataSourceLoader.java JdbcProvider.java
                        RawXADataSourceLoader.java XADataSourceLoader.java
  Log:
  Change to the unified log4j based org.jboss.logging.Logger class.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.4.2   +4 -4      jboss/src/main/org/jboss/jdbc/Attic/HypersonicDatabase.java
  
  Index: HypersonicDatabase.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jdbc/Attic/HypersonicDatabase.java,v
  retrieving revision 1.8.4.1
  retrieving revision 1.8.4.2
  diff -u -r1.8.4.1 -r1.8.4.2
  --- HypersonicDatabase.java   2001/09/30 22:10:43     1.8.4.1
  +++ HypersonicDatabase.java   2001/11/20 09:42:53     1.8.4.2
  @@ -28,7 +28,7 @@
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Rickard Öberg</a>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>.
    *   @author Peter Fagerlund [EMAIL PROTECTED] @see stopService()
  - *   @version $Revision: 1.8.4.1 $
  + *   @version $Revision: 1.8.4.2 $
    */
   public class HypersonicDatabase
      extends ServiceMBeanSupport
  @@ -121,7 +121,7 @@
            embeddedDBServer.runEmbedded(args, error);
            error.wait();
         }      
  -      category.info("Database started");
  +      log.info("Database started");
      }
   
      /**
  @@ -152,11 +152,11 @@
            statement=connection.createStatement();
            statement.executeQuery(cmd);
            
  -         category.info("Database closed clean");         
  +         log.info("Database closed clean");         
         }
         catch(Throwable e)
         {
  -         category.error("Database closed failed", e);
  +         log.error("Database closed failed", e);
         }      
         embeddedDBServer = null;
      }
  
  
  
  1.3.6.1   +2 -3      jboss/src/main/org/jboss/jdbc/Attic/InstantDBDatabase.java
  
  Index: InstantDBDatabase.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jdbc/Attic/InstantDBDatabase.java,v
  retrieving revision 1.3
  retrieving revision 1.3.6.1
  diff -u -r1.3 -r1.3.6.1
  --- InstantDBDatabase.java    2000/12/07 15:44:50     1.3
  +++ InstantDBDatabase.java    2001/11/20 09:42:53     1.3.6.1
  @@ -20,7 +20,6 @@
   
   import org.hsql.Server;
   
  -import org.jboss.logging.Log;
   import org.jboss.util.ServiceMBeanSupport;
   
   /**
  @@ -28,7 +27,7 @@
    *      
    *   @see <related>
    *   @author Rickard Öberg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.3 $
  + *   @version $Revision: 1.3.6.1 $
    */
   public class InstantDBDatabase
      extends ServiceMBeanSupport
  @@ -71,7 +70,7 @@
         DataSource ds = (DataSource)new InitialContext().lookup(poolName);
         Connection con = ds.getConnection();
         con.close();
  -      log.log("Database started");
  +      log.info("Database started");
      }
      
      public void stopService()
  
  
  
  1.10.4.1  +6 -7      jboss/src/main/org/jboss/jdbc/Attic/JDBCDataSourceLoader.java
  
  Index: JDBCDataSourceLoader.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jdbc/Attic/JDBCDataSourceLoader.java,v
  retrieving revision 1.10
  retrieving revision 1.10.4.1
  diff -u -r1.10 -r1.10.4.1
  --- JDBCDataSourceLoader.java 2001/05/15 08:00:49     1.10
  +++ JDBCDataSourceLoader.java 2001/11/20 09:42:53     1.10.4.1
  @@ -18,14 +18,13 @@
   import javax.naming.NamingException;
   import javax.sql.DataSource;
   import org.jboss.pool.jdbc.JDBCPoolDataSource;
  -import org.jboss.logging.LogWriter;
   import org.jboss.util.ServiceMBeanSupport;
  -import org.jboss.logging.Logger;
  +import org.jboss.logging.log4j.CategoryWriter;
   
   /**
    * Service that loads a JDBC 1 connection pool.  The constructors are called by
    * the JMX engine based on your MLET tags.
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.10.4.1 $
    * @author Aaron Mulder ([EMAIL PROTECTED])
    */
   public class JDBCDataSourceLoader extends ServiceMBeanSupport implements 
JDBCDataSourceLoaderMBean {
  @@ -86,7 +85,7 @@
       }
   
       public void setLoggingEnabled(boolean enabled) {
  -        PrintWriter writer = enabled ? new LogWriter(log) : null;
  +        PrintWriter writer = enabled ? new CategoryWriter(log.getCategory()) : null;
           try {
               source.setLogWriter(writer);
           } catch(Exception e) {
  @@ -207,9 +206,9 @@
           try {
               String name = source.getPoolName();
               new InitialContext().unbind("java:/"+name);
  -            log.log("JDBC Connection pool "+name+" removed from JNDI");
  +            log.info("JDBC Connection pool "+name+" removed from JNDI");
               source.close();
  -            log.log("JDBC Connection pool "+name+" shut down");
  +            log.info("JDBC Connection pool "+name+" shut down");
           } catch (NamingException e) {
               // Ignore
           }
  @@ -223,7 +222,7 @@
           // Bind in JNDI
           bind(new InitialContext(), "java:/" + source.getPoolName(), source);
   
  -        log.log("JDBC Connection pool "+source.getPoolName()+" bound to 
java:/"+source.getPoolName());
  +        log.info("JDBC Connection pool "+source.getPoolName()+" bound to 
java:/"+source.getPoolName());
   
           // Test database
           source.getConnection().close();
  
  
  
  1.5.4.1   +3 -5      jboss/src/main/org/jboss/jdbc/Attic/JdbcProvider.java
  
  Index: JdbcProvider.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jdbc/Attic/JdbcProvider.java,v
  retrieving revision 1.5
  retrieving revision 1.5.4.1
  diff -u -r1.5 -r1.5.4.1
  --- JdbcProvider.java 2001/04/19 21:52:29     1.5
  +++ JdbcProvider.java 2001/11/20 09:42:53     1.5.4.1
  @@ -13,14 +13,12 @@
   
   import javax.management.*;
   
  -import org.jboss.logging.Log;
  -
   /**
    * Provides a JDBC driver loading mechanism.
    *      
    * @see <related>
    * @author Rickard Öberg ([EMAIL PROTECTED])
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.5.4.1 $
    */
   public class JdbcProvider
      extends org.jboss.util.ServiceMBeanSupport
  @@ -71,10 +69,10 @@
            try
            {
               Class.forName(driver);
  -            log.log("Loaded JDBC-driver:"+driver);
  +            log.info("Loaded JDBC-driver:"+driver);
            } catch (Exception e)
            {
  -            log.error("Could not load driver:"+driver);
  +            log.error("Could not load driver:"+driver, e);
            }
         }
      }
  
  
  
  1.2.4.1   +13 -13    jboss/src/main/org/jboss/jdbc/Attic/RawXADataSourceLoader.java
  
  Index: RawXADataSourceLoader.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jdbc/Attic/RawXADataSourceLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- RawXADataSourceLoader.java        2001/04/20 08:40:59     1.2
  +++ RawXADataSourceLoader.java        2001/11/20 09:42:53     1.2.4.1
  @@ -30,15 +30,15 @@
   
   import javax.sql.XADataSource;
   
  -import org.jboss.logging.Log;
  -import org.jboss.logging.LogWriter;
  +import org.jboss.logging.Logger;
  +import org.jboss.logging.log4j.CategoryWriter;
   import org.jboss.util.ServiceMBeanSupport;
   
   /**
    * Service that loads a JDBC 2 std. extension-compliant
    * <code>XADataSource</code> and makes it available through JNDI.
    *
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.2.4.1 $
    * @author Aaron Mulder ([EMAIL PROTECTED])
    * @author Toby Allsopp ([EMAIL PROTECTED])
    */
  @@ -66,14 +66,15 @@
      public void setPoolName(String name)
      {
         this.name = name.trim();
  -      log = Log.createLog(name);
  +      String logName = RawXADataSourceLoader.class.getName() + '.' + name;
  +      log = Logger.getLogger(logName);
      }
      
      public String getPoolName()
      {
         return name;
      }
  -   
  +
      public void setDataSourceClass(String clazz)
      {
         dataSourceClass = clazz.trim();
  @@ -137,8 +138,7 @@
            catch (IOException ioe)
            {
               log.error("Couldn't convert properties string '" + properties +
  -                      "' to Properties");
  -            log.exception(ioe);
  +                      "' to Properties", ioe);
            }
            for (Iterator i = props.entrySet().iterator(); i.hasNext();)
            {
  @@ -157,13 +157,13 @@
               }
               catch (NoSuchMethodException e)
               {
  -               log.warning("No setter method for attribute '" + attributeName +
  -                           "' - skipping");
  +               log.warn("No setter method for attribute '" + attributeName +
  +                           "' - skipping", e);
               }
            }
         }
      
  -      PrintWriter writer = loggingEnabled ? new LogWriter(log) : null;
  +      PrintWriter writer = loggingEnabled ? new CategoryWriter(log.getCategory()) : 
null;
         vendorSource.setLogWriter(writer);
   
         // Test database
  @@ -174,7 +174,7 @@
              new Reference(vendorSource.getClass().getName(),
                            getClass().getName(), null));
   
  -      log.log("XA Data source "+getPoolName()+" bound to java:/"+getPoolName());
  +      log.info("XA Data source "+getPoolName()+" bound to java:/"+getPoolName());
      }
   
      public void stopService()
  @@ -183,8 +183,8 @@
         try {
            String name = getPoolName();
            new InitialContext().unbind("java:/"+name);
  -         log.log("XA Data source "+name+" removed from JNDI");
  -         log.log("XA Data source "+name+" shut down");
  +         log.info("XA Data source "+name+" removed from JNDI");
  +         log.info("XA Data source "+name+" shut down");
         } catch (NamingException e)
         {
            // Ignore
  
  
  
  1.16.4.3  +10 -8     jboss/src/main/org/jboss/jdbc/Attic/XADataSourceLoader.java
  
  Index: XADataSourceLoader.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jdbc/Attic/XADataSourceLoader.java,v
  retrieving revision 1.16.4.2
  retrieving revision 1.16.4.3
  diff -u -r1.16.4.2 -r1.16.4.3
  --- XADataSourceLoader.java   2001/11/05 22:50:28     1.16.4.2
  +++ XADataSourceLoader.java   2001/11/20 09:42:53     1.16.4.3
  @@ -20,10 +20,11 @@
   import javax.naming.NameNotFoundException;
   import javax.naming.NamingException;
   import javax.sql.XADataSource;
  +
   import org.jboss.pool.jdbc.xa.XAPoolDataSource;
  -import org.jboss.logging.LogWriter;
  +import org.jboss.logging.Logger;
  +import org.jboss.logging.log4j.CategoryWriter;
   import org.jboss.util.ServiceMBeanSupport;
  -import org.jboss.logging.Log;
   import java.sql.Connection;
   
   /**
  @@ -31,7 +32,7 @@
    * pool generates connections that are registered with the current Transaction
    * and support two-phase commit.  The constructors are called by the JMX engine
    * based on your MLET tags.
  - * @version $Revision: 1.16.4.2 $
  + * @version $Revision: 1.16.4.3 $
    * @author <a href="mailto:[EMAIL PROTECTED]";>Aaron Mulder</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>danch (Dan Christopherson)</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Bill Burke</a>
  @@ -83,7 +84,8 @@
      public void setPoolName(String name)
      {
         this.name = name;
  -      log = Log.createLog(name);
  +      String logName = getClass().getName() + '.' + name;
  +      log = Logger.getLogger(logName);
      }
   
      public String getPoolName()
  @@ -368,7 +370,7 @@
         if(password != null && password.length() > 0)
            getSource().setJDBCPassword(password);
   
  -      PrintWriter writer = loggingEnabled ? new LogWriter(log) : null;
  +      PrintWriter writer = loggingEnabled ? new CategoryWriter(log.getCategory()) : 
null;
         getSource().setLogWriter(writer);
         getSource().getDataSource().setLogWriter(writer);
         getSource().setMinSize(minSize);
  @@ -403,7 +405,7 @@
         // Bind in JNDI
         bind(new InitialContext(), "java:/"+getSource().getPoolName(), source);
   
  -      log.log("XA Connection pool "+getSource().getPoolName()+" bound to 
java:/"+getSource().getPoolName());
  +      log.info("XA Connection pool "+getSource().getPoolName()+" bound to 
java:/"+getSource().getPoolName());
   
         // Test database
         try {
  @@ -421,9 +423,9 @@
         try {
            String name = getSource().getPoolName();
            new InitialContext().unbind("java:/"+name);
  -         log.log("XA Connection pool "+name+" removed from JNDI");
  +         log.info("XA Connection pool "+name+" removed from JNDI");
            cleanupSource();
  -         log.log("XA Connection pool "+name+" shut down");
  +         log.info("XA Connection pool "+name+" shut down");
         } catch (NamingException e)
         {
            // Ignore
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to