openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r454191 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
Date Sun, 08 Oct 2006 19:05:15 GMT
Author: awhite
Date: Sun Oct  8 12:05:15 2006
New Revision: 454191

URL: http://svn.apache.org/viewvc?view=rev&rev=454191
Log:
Always use a ConfigurationProvider that supplies a spec.


Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistence.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java?view=diff&rev=454191&r1=454190&r2=454191
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
Sun Oct  8 12:05:15 2006
@@ -95,7 +95,7 @@
         }
     }
 
-    private static BrokerFactory invokeFactory (ConfigurationProvider conf,
+    private static BrokerFactory invokeFactory(ConfigurationProvider conf,
         ClassLoader loader, String methodName)
         throws InvocationTargetException, NoSuchMethodException,
             IllegalAccessException {

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistence.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistence.java?view=diff&rev=454191&r1=454190&r2=454191
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistence.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/OpenJPAPersistence.java
Sun Oct  8 12:05:15 2006
@@ -165,7 +165,8 @@
      * overrides.
      */
     public static OpenJPAEntityManagerFactory getEntityManagerFactory(Map map) {
-        ConfigurationProvider cp = new MapConfigurationProvider(map);
+        ConfigurationProvider cp = new PersistenceProductDerivation.
+            ConfigurationProviderImpl(map);
         try {
             return toEntityManagerFactory(Bootstrap.getBrokerFactory(cp, null));
         } catch (Exception e) {

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java?view=diff&rev=454191&r1=454190&r2=454191
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
Sun Oct  8 12:05:15 2006
@@ -355,11 +355,18 @@
     /**
      * Custom configuration provider.   
      */
-    private static class ConfigurationProviderImpl
+    public static class ConfigurationProviderImpl
         extends MapConfigurationProvider {
 
         private String _source;
 
+        public ConfigurationProviderImpl() {
+        }
+
+        public ConfigurationProviderImpl(Map props) {
+            super(props);
+        }
+
         /**
          * Set the source of information in this provider.
          */
@@ -374,8 +381,10 @@
             super.setInto(conf, null);
 
             Log log = conf.getConfigurationLog();
-            if (log.isTraceEnabled())
-                log.trace(_loc.get("conf-load", _source, getProperties()));
+            if (log.isTraceEnabled()) {
+                String src = (_source == null) ? "?" : _source;
+                log.trace(_loc.get("conf-load", src, getProperties()));
+            }
         }
     }
 



Mime
View raw message