Author: curtisr7
Date: Wed Nov 18 20:15:38 2009
New Revision: 881917
URL: http://svn.apache.org/viewvc?rev=881917&view=rev
Log: (empty)
Modified:
openjpa/sandboxes/perf/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
Modified:
openjpa/sandboxes/perf/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL:
http://svn.apache.org/viewvc/openjpa/sandboxes/perf/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?rev=881917&r1=881916&r2=881917&view=diff
==============================================================================
---
openjpa/sandboxes/perf/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
(original)
+++
openjpa/sandboxes/perf/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
Wed Nov 18 20:15:38 2009
@@ -156,10 +156,9 @@
new LifecycleEventManager.ListenerList(3);
private ReentrantLock _lock = new ReentrantLock();
- protected boolean _eagerPersistentMetaData = false;
- protected boolean _noLock = false;
+ protected boolean _preload = false;
- private static final String EAGER_PERSISTENT_META_DATA =
"EagerPersistentMetaData";
+ private static final String PRELOAD_STR = "preload";
/**
* Default constructor. Configure via {...@link Configurable}.
@@ -286,40 +285,33 @@
else
_sourceMode &= ~mode;
}
-
+
/**
- * Sets whether this repository will load all MetaData for all known
persistent classes at initialization.
- * Defaults to false.
+ * Sets whether this repository will load all MetaData for all known
persistent classes at
+ * initialization and remove all locking. Defaults to false.
*/
- public void setEagerPersistentMetaData(boolean b) {
- _eagerPersistentMetaData = b;
+ public void setPreload(boolean p) {
+ _preload = p;
}
/**
* Sets whether this repository will load all MetaData for all known
persistent classes at initialization.
* Defaults to false.
*/
- public boolean getEagerPersistentMetaData() {
- return _eagerPersistentMetaData;
+ public boolean getPreload() {
+ return _preload;
}
- public void setNoLock(boolean b){
- _noLock = b;
- }
- public boolean getNoLock(){
- return _noLock;
- }
/**
- * If the openjpa.MetaDataRepository plugin value
EagerPersistentMetaData=false , this method will noop. If
EagerPersistentMetaData=true, this
- * method will load all persistent classes and ALL MetaData for those
persistent classes.
- * <p>
- * If noLock=true, calling this method will remove ALL locking from this
class if EagerPersistentMetaData=true.
+ * If the openjpa.MetaDataRepository plugin value Preload=true is set,
this method will load all
+ * MetaData for all persistent classes and will remove locking from this
class.
* <p>
*
- * NOTE : This method is not thread safe and should ONLY be called by the
PersistenceProviderImpl.
+ * NOTE : This method is not thread safe and should ONLY be called by the
+ * PersistenceProviderImpl.
*/
- public void initializeEager() {
- if (_eagerPersistentMetaData == false) {
+ public void preload() {
+ if (_preload == false) {
return;
}
// If pooling EMFs, this method may be invoked more than once. Only
perform this work once.
@@ -328,7 +320,7 @@
}
if (_log.isTraceEnabled()) {
- _log.trace("MetaDataRepository NoLock=" + _noLock + ",
EagerPersistentMetaData=" + _eagerPersistentMetaData);
+ _log.trace("MetaDataRepository Preload=" + _preload);
}
MultiClassLoader multi =
AccessController.doPrivileged(J2DoPrivHelper.newMultiClassLoaderAction());
@@ -361,9 +353,7 @@
// Hook in this class as a listener and process registered classes
list to populate _aliases list.
PCRegistry.addRegisterClassListener(this);
processRegisteredClasses(multi);
- if (_noLock == true) {
- _lock = null;
- }
+ _lock = null;
_eagerProcessingComplete = true;
}
@@ -1748,7 +1738,7 @@
if (_implGen == null) {
_implGen = new InterfaceImplGenerator(this);
}
- if (_eagerPersistentMetaData == true && _noLock == true) {
+ if (_preload == true) {
_oids = new HashMap();
_impls = new HashMap();
_ifaces = new HashMap();
@@ -2268,11 +2258,11 @@
}
/**
- * This helper method returns true if Options paramater has the property
EagerPersistentTypes or
- * EagerPersistentMetaData set to true.
+ * This helper method returns true if Options paramater has the property
Preload
+ * set to true.
*/
- public static boolean needsInitializeEager(Options o) {
- if (o.getBooleanProperty(EAGER_PERSISTENT_META_DATA) == true) {
+ public static boolean needsPreload(Options o) {
+ if (o.getBooleanProperty(PRELOAD_STR) == true) {
return true;
}
return false;