cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r471893 - /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
Date Mon, 06 Nov 2006 22:06:16 GMT
Author: aadamchik
Date: Mon Nov  6 14:06:15 2006
New Revision: 471893

URL: http://svn.apache.org/viewvc?view=rev&rev=471893
Log:
CAY-702: Improve DBCPDataSourceFactory to use it for a JettyPlus DataSource
(improvement to support standalone mode of operation) 

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java?view=diff&rev=471893&r1=471892&r2=471893
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/conf/DBCPDataSourceFactory.java
Mon Nov  6 14:06:15 2006
@@ -21,6 +21,7 @@
 
 import javax.sql.DataSource;
 
+import org.apache.cayenne.util.ResourceLocator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -64,8 +65,21 @@
      */
     public DataSource getDataSource(String location) throws Exception {
 
+        ResourceLocator resourceLocator;
+
+        if (parentConfiguration != null) {
+            resourceLocator = parentConfiguration.getResourceLocator();
+        }
+        else {
+            resourceLocator = new ResourceLocator();
+            resourceLocator.setSkipAbsolutePath(false);
+            resourceLocator.setSkipHomeDirectory(true);
+            resourceLocator.setSkipClasspath(false);
+            resourceLocator.setSkipCurrentDirectory(false);
+        }
+
         DBCPDataSourceProperties properties = new DBCPDataSourceProperties(
-                parentConfiguration.getResourceLocator(),
+                resourceLocator,
                 location);
 
         if (logger.isDebugEnabled()) {



Mime
View raw message