tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory TyrexDataSourceFactory.java
Date Fri, 31 May 2002 21:17:35 GMT
remm        2002/05/31 14:17:35

  Modified:    catalina/src/share/org/apache/naming/factory Tag:
                        tomcat_40_branch TyrexDataSourceFactory.java
  Log:
  - Revert patch (return an EnabledDataSource, which doesn't do much,
    but is a lot easier to setup).
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.2   +20 -30    jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/TyrexDataSourceFactory.java
  
  Index: TyrexDataSourceFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/TyrexDataSourceFactory.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- TyrexDataSourceFactory.java	22 Feb 2002 20:11:50 -0000	1.3.2.1
  +++ TyrexDataSourceFactory.java	31 May 2002 21:17:35 -0000	1.3.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/TyrexDataSourceFactory.java,v
1.3.2.1 2002/02/22 20:11:50 remm Exp $
  - * $Revision: 1.3.2.1 $
  - * $Date: 2002/02/22 20:11:50 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/factory/TyrexDataSourceFactory.java,v
1.3.2.2 2002/05/31 21:17:35 remm Exp $
  + * $Revision: 1.3.2.2 $
  + * $Date: 2002/05/31 21:17:35 $
    *
    * ====================================================================
    *
  @@ -102,7 +102,7 @@
    * </ul>
    * 
    * @author Remy Maucherat
  - * @version $Revision: 1.3.2.1 $ $Date: 2002/02/22 20:11:50 $
  + * @version $Revision: 1.3.2.2 $ $Date: 2002/05/31 21:17:35 $
    */
   
   public class TyrexDataSourceFactory
  @@ -211,21 +211,26 @@
                       Driver databaseDriver = (Driver) driverClass.newInstance();
                       DriverManager.registerDriver(databaseDriver);
                       
  -                    ServerDataSource sds = 
  -                        new ServerDataSource((javax.sql.XADataSource) ds);
  -                    
  -                    currentRefAddr = ref.get(DESCRIPTION);
  -                    if (currentRefAddr != null) {
  -                        sds.setDescription
  -                            (currentRefAddr.getContent().toString());
  +                    if (ref.getClassName().equals
  +                        ("tyrex.jdbc.ServerDataSource")) {
  +                        
  +                        ServerDataSource sds = 
  +                            new ServerDataSource((javax.sql.XADataSource) ds);
  +                        
  +                        currentRefAddr = ref.get(DESCRIPTION);
  +                        if (currentRefAddr != null)
  +                            sds.setDescription
  +                                (currentRefAddr.getContent().toString());
  +                        
  +                        return sds;
  +                        
                       }
                       
  -                    return sds;
  +                    return ds;
                       
                   } catch (Throwable t) {
  -                    log("Cannot create DataSource, Exception", t);
  -                    throw new NamingException
  -                        ("Exception creating DataSource: " + t.getMessage());
  +                    // Another factory could handle this, so just give up
  +                    return null;
                   }
                   
               } else {
  @@ -236,21 +241,6 @@
               return null;
           }
           
  -    }
  -
  -
  -    // -------------------------------------------------------- Private Methods
  -
  -
  -    private void log(String message) {
  -        System.out.print("TyrexDataSourceFactory:  ");
  -        System.out.println(message);
  -    }
  -
  -
  -    private void log(String message, Throwable exception) {
  -        log(message);
  -        exception.printStackTrace(System.out);
       }
   
   
  
  
  

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


Mime
View raw message