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) {
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);
}

View File

@ -28,6 +28,8 @@ import org.apache.openjpa.kernel.BrokerFactory;
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 @@ public class MetaDataCacheMaintenance {
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 @@ public class MetaDataCacheMaintenance {
}
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;
}

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-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.