openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r651121 - in /openjpa/branches/1.1.x/openjpa-kernel/src/main: java/org/apache/openjpa/conf/CacheMarshallerImpl.java java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java resources/org/apache/openjpa/conf/localizer.properties
Date Thu, 24 Apr 2008 00:20:29 GMT
Author: pcl
Date: Wed Apr 23 17:20:27 2008
New Revision: 651121

URL: http://svn.apache.org/viewvc?rev=651121&view=rev
Log:
Make the MetaDataCacheMarshaller more configurable, and fix error handling in CacheMarshallerImpl.

Modified:
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java
    openjpa/branches/1.1.x/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java?rev=651121&r1=651120&r2=651121&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
Wed Apr 23 17:20:27 2008
@@ -89,11 +89,11 @@
         } catch (Exception e) {
             if (_consumeErrors) {
                 if (_log.isWarnEnabled())
-                    _log.warn(_loc.get("cache-marshaller-load-exception",
+                    _log.warn(_loc.get("cache-marshaller-load-exception-ignore",
                         _inputURL), e);
             } else {
                 throw new InternalException(
-                    _loc.get("cache-marshaller-load-exception",
+                    _loc.get("cache-marshaller-load-exception-fatal",
                         _inputURL),
                     e);
             }

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java?rev=651121&r1=651120&r2=651121&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java
Wed Apr 23 17:20:27 2008
@@ -28,6 +28,8 @@
 import org.apache.openjpa.kernel.Query;
 import org.apache.openjpa.lib.util.Options;
 import org.apache.openjpa.lib.log.Log;
+import org.apache.openjpa.lib.conf.MapConfigurationProvider;
+import org.apache.openjpa.lib.conf.ConfigurationProvider;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.MetaDataRepository;
 import org.apache.openjpa.meta.QueryMetaData;
@@ -52,13 +54,16 @@
         boolean devpath = opts.getBooleanProperty("scanDevPath", "ScanDevPath",
             true);
 
-        BrokerFactory factory = Bootstrap.newBrokerFactory();
+        ConfigurationProvider cp = new MapConfigurationProvider(opts);
+        BrokerFactory factory = Bootstrap.newBrokerFactory(cp, null);
         try {
             MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance(
                 factory, devpath);
 
-            if (args.length != 1)
+            if (args.length != 1) {
                 usage();
+                return;
+            }
 
             if ("store".equals(args[0]))
                 maint.store();
@@ -97,8 +102,8 @@
     }
 
     private static int usage() {
-        System.err.println("Usage: java MetaDataCacheMaintenance "
-            + "[-scanDevPath t|f] store | dump");
+        System.err.println("Usage: java MetaDataCacheMaintenance " +
+            "[-scanDevPath t|f] [-<openjpa.PropertyName> value] store | dump");
         return -1;
     }
 

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties?rev=651121&r1=651120&r2=651121&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties
Wed Apr 23 17:20:27 2008
@@ -556,9 +556,12 @@
 cache-marshaller-loaded: Loaded cached data of type {0} from file {1}.
 cache-marshaller-no-inputs: No InputURL or InputResource was specified for \
     CacheMarshaller {0}. Cannot load data if no input was specified.
-cache-marshaller-load-exception: An error occurred while loading cached data \
-	from {0}. The exception is logged with this message; it will be consumed \
-	and ignored.
+cache-marshaller-load-exception-ignore: An error occurred while loading cached \
+	data from {0}. The exception is logged with this message; it will be \
+	consumed and ignored.
+cache-marshaller-load-exception-fatal: An error occurred while loading cached \
+	data from {0}. The exception is logged with this message; it will be \
+	thrown.
 cache-marshaller-stored: Stored data of type {0} to file {1}.
 cache-marshaller-no-output-file: No OutputFile was specified for \
     CacheMarshaller {0}. Cannot store data if no output was specified.



Mime
View raw message