Backported r651121 to trunk.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@666891 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Patrick Linskey 2008-06-11 23:21:46 +00:00
parent 4d668a44dd
commit 8fb7ca2b5b
3 changed files with 17 additions and 9 deletions

View File

@ -89,11 +89,11 @@ public class CacheMarshallerImpl
} catch (Exception e) { } catch (Exception e) {
if (_consumeErrors) { if (_consumeErrors) {
if (_log.isWarnEnabled()) if (_log.isWarnEnabled())
_log.warn(_loc.get("cache-marshaller-load-exception", _log.warn(_loc.get("cache-marshaller-load-exception-ignore",
_inputURL), e); _inputURL), e);
} else { } else {
throw new InternalException( throw new InternalException(
_loc.get("cache-marshaller-load-exception", _loc.get("cache-marshaller-load-exception-fatal",
_inputURL), _inputURL),
e); e);
} }

View File

@ -28,6 +28,8 @@ import org.apache.openjpa.kernel.BrokerFactory;
import org.apache.openjpa.kernel.Query; import org.apache.openjpa.kernel.Query;
import org.apache.openjpa.lib.util.Options; import org.apache.openjpa.lib.util.Options;
import org.apache.openjpa.lib.log.Log; 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.ClassMetaData;
import org.apache.openjpa.meta.MetaDataRepository; import org.apache.openjpa.meta.MetaDataRepository;
import org.apache.openjpa.meta.QueryMetaData; import org.apache.openjpa.meta.QueryMetaData;
@ -52,13 +54,16 @@ public class MetaDataCacheMaintenance {
boolean devpath = opts.getBooleanProperty("scanDevPath", "ScanDevPath", boolean devpath = opts.getBooleanProperty("scanDevPath", "ScanDevPath",
true); true);
BrokerFactory factory = Bootstrap.newBrokerFactory(); ConfigurationProvider cp = new MapConfigurationProvider(opts);
BrokerFactory factory = Bootstrap.newBrokerFactory(cp, null);
try { try {
MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance( MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance(
factory, devpath); factory, devpath);
if (args.length != 1) if (args.length != 1) {
usage(); usage();
return;
}
if ("store".equals(args[0])) if ("store".equals(args[0]))
maint.store(); maint.store();
@ -97,8 +102,8 @@ public class MetaDataCacheMaintenance {
} }
private static int usage() { private static int usage() {
System.err.println("Usage: java MetaDataCacheMaintenance " System.err.println("Usage: java MetaDataCacheMaintenance " +
+ "[-scanDevPath t|f] store | dump"); "[-scanDevPath t|f] [-<openjpa.PropertyName> value] store | dump");
return -1; return -1;
} }

View File

@ -556,9 +556,12 @@ diff-specs: Attempt to configure for multiple specifications. Was configured \
cache-marshaller-loaded: Loaded cached data of type {0} from file {1}. cache-marshaller-loaded: Loaded cached data of type {0} from file {1}.
cache-marshaller-no-inputs: No InputURL or InputResource was specified for \ cache-marshaller-no-inputs: No InputURL or InputResource was specified for \
CacheMarshaller {0}. Cannot load data if no input was specified. CacheMarshaller {0}. Cannot load data if no input was specified.
cache-marshaller-load-exception: An error occurred while loading cached data \ cache-marshaller-load-exception-ignore: An error occurred while loading cached \
from {0}. The exception is logged with this message; it will be consumed \ data from {0}. The exception is logged with this message; it will be \
and ignored. 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-stored: Stored data of type {0} to file {1}.
cache-marshaller-no-output-file: No OutputFile was specified for \ cache-marshaller-no-output-file: No OutputFile was specified for \
CacheMarshaller {0}. Cannot store data if no output was specified. CacheMarshaller {0}. Cannot store data if no output was specified.