Author: kwsutter
Date: Tue Sep 12 08:31:34 2006
New Revision: 442619
URL: http://svn.apache.org/viewvc?view=rev&rev=442619
Log:
First step in the extensibility re-organization. Moved ProductDerivation over
to lib, along with the corresponding
re-factoring. Still not clean, but the tests are still passing... More to
come shortly.
Added:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation
- copied, changed from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivation.java
- copied, changed from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivation.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivations.java
- copied, changed from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation
- copied, changed from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation
- copied, changed from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation
Removed:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivation.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation
Modified:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCProductDerivation.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCPersistenceProductDerivation.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLConfiguration.java
Modified:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java?view=diff&rev=442619&r1=442618&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
Tue Sep 12 08:31:34 2006
@@ -20,7 +20,7 @@
import javax.sql.DataSource;
import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
-import org.apache.openjpa.conf.ProductDerivations;
+import org.apache.openjpa.conf.OpenJPAProductDerivations;
import org.apache.openjpa.jdbc.kernel.EagerFetchModes;
import org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory;
import org.apache.openjpa.jdbc.kernel.LRSSizes;
@@ -307,7 +307,7 @@
supportedOptions().remove(OPTION_NULL_CONTAINER);
if (derivations)
- ProductDerivations.beforeConfigurationLoad(this);
+ OpenJPAProductDerivations.beforeConfigurationLoad(this);
if (loadGlobals)
loadGlobals();
}
Modified:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCProductDerivation.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCProductDerivation.java?view=diff&rev=442619&r1=442618&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCProductDerivation.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCProductDerivation.java
Tue Sep 12 08:31:34 2006
@@ -17,15 +17,16 @@
import org.apache.openjpa.conf.BrokerFactoryValue;
import org.apache.openjpa.conf.OpenJPAConfiguration;
-import org.apache.openjpa.conf.ProductDerivation;
+import org.apache.openjpa.conf.OpenJPAProductDerivation;
import org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory;
+import org.apache.openjpa.lib.conf.Configuration;
import org.apache.openjpa.lib.conf.ConfigurationProvider;
/**
* Sets JDBC as default store.
*/
public class JDBCProductDerivation
- implements ProductDerivation {
+ implements OpenJPAProductDerivation {
static {
BrokerFactoryValue.addDefaultAlias("jdbc",
@@ -44,9 +45,11 @@
}
}
- public void beforeConfigurationLoad(OpenJPAConfiguration c) {
+// public void beforeConfigurationLoad(OpenJPAConfiguration c) {
+ public void beforeConfigurationLoad(Configuration c) {
}
- public void afterSpecificationSet(OpenJPAConfiguration c) {
+ // public void afterSpecificationSet(OpenJPAConfiguration c) {
+ public void afterSpecificationSet(Configuration c) {
}
}
Copied:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation
(from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation)
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation?view=diff&rev=442619&p1=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation&r1=440888&p2=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation&r2=442619
==============================================================================
(empty)
Modified:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java?view=diff&rev=442619&r1=442618&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
Tue Sep 12 08:31:34 2006
@@ -507,7 +507,7 @@
supportedOptions.add(OPTION_DATASTORE_CONNECTION);
if (derivations)
- ProductDerivations.beforeConfigurationLoad(this);
+ OpenJPAProductDerivations.beforeConfigurationLoad(this);
if (loadGlobals)
loadGlobals();
}
@@ -533,7 +533,7 @@
}
this.spec = spec;
- ProductDerivations.afterSpecificationSet(this);
+ OpenJPAProductDerivations.afterSpecificationSet(this);
return true;
}
Copied:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivation.java
(from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivation.java)
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivation.java?view=diff&rev=442619&p1=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivation.java&r1=440888&p2=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivation.java&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivation.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivation.java
Tue Sep 12 08:31:34 2006
@@ -16,7 +16,7 @@
package org.apache.openjpa.conf;
import org.apache.openjpa.lib.conf.Configuration;
-import org.apache.openjpa.lib.conf.ConfigurationProvider;
+import org.apache.openjpa.lib.conf.ProductDerivation;
/**
* Hooks for deriving products with additional functionality.
@@ -28,36 +28,36 @@
*
* @since 0.4.1
*/
-public interface ProductDerivation {
+public interface OpenJPAProductDerivation extends ProductDerivation {
public static final int TYPE_SPEC = 0;
- public static final int TYPE_PRODUCT = 1;
+// public static final int TYPE_PRODUCT = 1;
public static final int TYPE_STORE = 2;
public static final int TYPE_SPEC_STORE = 3;
- public static final int TYPE_PRODUCT_STORE = 4;
- public static final int TYPE_FEATURE = 5;
-
- /**
- * Return the type of derivation.
- */
- public int getType();
-
- /**
- * Provides the instance with a callback to mutate the initial properties
- * of the [EMAIL PROTECTED] ConfigurationProvider}. This is primarily to
alter or
- * add properties that determine what type of configuration is constructed,
- * and therefore is typically used at runtime only.
- */
- public void beforeConfigurationConstruct(ConfigurationProvider cp);
-
- /**
- * Provides the instance with the opportunity to mutate
- * <code>conf</code> before the user configuration is applied.
- */
- public void beforeConfigurationLoad(OpenJPAConfiguration conf);
-
- /**
- * Called after the specification has been set.
- */
- public void afterSpecificationSet(OpenJPAConfiguration conf);
+// public static final int TYPE_PRODUCT_STORE = 4;
+// public static final int TYPE_FEATURE = 5;
+//
+// /**
+// * Return the type of derivation.
+// */
+// public int getType();
+//
+// /**
+// * Provides the instance with a callback to mutate the initial properties
+// * of the [EMAIL PROTECTED] ConfigurationProvider}. This is primarily to
alter or
+// * add properties that determine what type of configuration is
constructed,
+// * and therefore is typically used at runtime only.
+// */
+// public void beforeConfigurationConstruct(ConfigurationProvider cp);
+//
+// /**
+// * Provides the instance with the opportunity to mutate
+// * <code>conf</code> before the user configuration is applied.
+// */
+// public void beforeConfigurationLoad(OpenJPAConfiguration conf);
+//
+// /**
+// * Called after the specification has been set.
+// */
+// public void afterSpecificationSet(OpenJPAConfiguration conf);
}
Copied:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivations.java
(from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java)
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivations.java?view=diff&rev=442619&p1=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java&r1=440888&p2=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivations.java&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAProductDerivations.java
Tue Sep 12 08:31:34 2006
@@ -31,13 +31,13 @@
* @author Abe White
* @nojavadoc
*/
-public class ProductDerivations {
+public class OpenJPAProductDerivations {
- private static final ProductDerivation[] _derivations;
+ private static final OpenJPAProductDerivation[] _derivations;
static {
- Class[] pdcls = Services.getImplementorClasses(ProductDerivation.class,
- ProductDerivation.class.getClassLoader());
+ Class[] pdcls =
Services.getImplementorClasses(OpenJPAProductDerivation.class,
+ OpenJPAProductDerivation.class.getClassLoader());
List derivations = new ArrayList(pdcls.length);
for (int i = 0; i < pdcls.length; i++) {
try {
@@ -51,19 +51,19 @@
// there must be some product derivation to define metadata factories,
// etc.
if (derivations.isEmpty()) {
- Localizer loc = Localizer.forPackage(ProductDerivations.class);
+ Localizer loc =
Localizer.forPackage(OpenJPAProductDerivations.class);
throw new
MissingResourceException(loc.get("no-product-derivations",
- ProductDerivation.class.getName()).getMessage(),
- ProductDerivations.class.getName(), "derivations");
+ OpenJPAProductDerivation.class.getName()).getMessage(),
+ OpenJPAProductDerivations.class.getName(), "derivations");
}
Collections.sort(derivations, new ProductDerivationComparator());
- _derivations = (ProductDerivation[]) derivations.toArray
- (new ProductDerivation[derivations.size()]);
+ _derivations = (OpenJPAProductDerivation[]) derivations.toArray
+ (new OpenJPAProductDerivation[derivations.size()]);
}
/**
- * Apply [EMAIL PROTECTED] ProductDerivation#beforeConfigurationConstruct}
callbacks
+ * Apply [EMAIL PROTECTED]
OpenJPAProductDerivation#beforeConfigurationConstruct} callbacks
* to the the given instance. Exceptions are swallowed.
*/
public static void beforeConfigurationConstruct(ConfigurationProvider cp) {
@@ -78,7 +78,7 @@
}
/**
- * Apply [EMAIL PROTECTED] ProductDerivation#beforeConfigurationLoad}
callbacks
+ * Apply [EMAIL PROTECTED]
OpenJPAProductDerivation#beforeConfigurationLoad} callbacks
* to the the given instance. Exceptions are swallowed.
*/
public static void beforeConfigurationLoad(OpenJPAConfiguration conf) {
@@ -93,7 +93,7 @@
}
/**
- * Apply [EMAIL PROTECTED] ProductDerivation#afterSpecificationSet}
callbacks
+ * Apply [EMAIL PROTECTED] OpenJPAProductDerivation#afterSpecificationSet}
callbacks
* to the the given instance. Exceptions are swallowed.
*/
public static void afterSpecificationSet(OpenJPAConfiguration conf) {
@@ -108,14 +108,14 @@
}
/**
- * Compare [EMAIL PROTECTED] ProductDerivation}s.
+ * Compare [EMAIL PROTECTED] OpenJPAProductDerivation}s.
*/
private static class ProductDerivationComparator
implements Comparator {
public int compare(Object o1, Object o2) {
- int type1 = ((ProductDerivation) o1).getType();
- int type2 = ((ProductDerivation) o2).getType();
+ int type1 = ((OpenJPAProductDerivation) o1).getType();
+ int type2 = ((OpenJPAProductDerivation) o2).getType();
if (type1 != type2)
return type1 - type2;
Modified:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java?view=diff&rev=442619&r1=442618&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Bootstrap.java
Tue Sep 12 08:31:34 2006
@@ -19,7 +19,7 @@
import java.lang.reflect.Method;
import org.apache.openjpa.conf.BrokerFactoryValue;
-import org.apache.openjpa.conf.ProductDerivations;
+import org.apache.openjpa.conf.OpenJPAProductDerivations;
import org.apache.openjpa.lib.conf.ConfigurationProvider;
import org.apache.openjpa.lib.conf.MapConfigurationProvider;
import org.apache.openjpa.lib.util.Localizer;
@@ -101,7 +101,7 @@
IllegalAccessException {
if (conf == null)
conf = new MapConfigurationProvider();
- ProductDerivations.beforeConfigurationConstruct(conf);
+ OpenJPAProductDerivations.beforeConfigurationConstruct(conf);
Class cls = getFactoryClass(conf, loader);
Method meth;
Added:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java?view=auto&rev=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java
(added)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivation.java
Tue Sep 12 08:31:34 2006
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openjpa.lib.conf;
+
+import org.apache.openjpa.lib.conf.Configuration;
+import org.apache.openjpa.lib.conf.ConfigurationProvider;
+
+/**
+ * Hooks for deriving products with additional functionality.
+ * All implementations of this interface will have a chance to mutate
+ * a [EMAIL PROTECTED] Configuration} both before and after the user-specified
+ * configuration data is loaded. The order in which the
+ * derivations are evaluated is determined by the specificity of the
+ * derivation type.
+ *
+ * @since 0.4.1
+ */
+public interface ProductDerivation {
+
+ public static final int TYPE_UNDEFINED = -1;
+// public static final int TYPE_SPEC = 0;
+// public static final int TYPE_PRODUCT = 1;
+// public static final int TYPE_STORE = 2;
+// public static final int TYPE_SPEC_STORE = 3;
+// public static final int TYPE_PRODUCT_STORE = 4;
+// public static final int TYPE_FEATURE = 5;
+
+ /**
+ * Return the type of derivation.
+ */
+ public int getType();
+
+ /**
+ * Provides the instance with a callback to mutate the initial properties
+ * of the [EMAIL PROTECTED] ConfigurationProvider}. This is primarily to
alter or
+ * add properties that determine what type of configuration is constructed,
+ * and therefore is typically used at runtime only.
+ */
+ public void beforeConfigurationConstruct(ConfigurationProvider cp);
+
+ /**
+ * Provides the instance with the opportunity to mutate
+ * <code>conf</code> before the user configuration is applied.
+ */
+ //public void beforeConfigurationLoad(OpenJPAConfiguration conf);
+ public void beforeConfigurationLoad(Configuration conf);
+
+ /**
+ * Called after the specification has been set.
+ */
+ //public void afterSpecificationSet(OpenJPAConfiguration conf);
+ public void afterSpecificationSet(Configuration conf);
+}
Modified:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCPersistenceProductDerivation.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCPersistenceProductDerivation.java?view=diff&rev=442619&r1=442618&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCPersistenceProductDerivation.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/JDBCPersistenceProductDerivation.java
Tue Sep 12 08:31:34 2006
@@ -16,9 +16,11 @@
package org.apache.openjpa.persistence.jdbc;
import org.apache.openjpa.conf.OpenJPAConfiguration;
-import org.apache.openjpa.conf.ProductDerivation;
+import org.apache.openjpa.conf.OpenJPAProductDerivation;
+import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
import org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl;
import org.apache.openjpa.jdbc.kernel.JDBCStoreManager;
+import org.apache.openjpa.lib.conf.Configuration;
import org.apache.openjpa.lib.conf.ConfigurationProvider;
import org.apache.openjpa.persistence.FetchPlan;
import org.apache.openjpa.persistence.PersistenceProductDerivation;
@@ -30,7 +32,7 @@
* @nojavadoc
*/
public class JDBCPersistenceProductDerivation
- implements ProductDerivation {
+ implements OpenJPAProductDerivation {
public int getType() {
return TYPE_SPEC_STORE;
@@ -39,11 +41,15 @@
public void beforeConfigurationConstruct(ConfigurationProvider cp) {
}
- public void beforeConfigurationLoad(OpenJPAConfiguration c) {
- c.getStoreFacadeTypeRegistry().registerImplementation(FetchPlan.class,
- JDBCStoreManager.class, JDBCFetchPlanImpl.class);
+// public void beforeConfigurationLoad(OpenJPAConfiguration c) {
+ public void beforeConfigurationLoad(Configuration c) {
+// TODO Ask Abe what this was used for and can it be moved?
+//
c.getStoreFacadeTypeRegistry().registerImplementation(FetchPlan.class,
+// JDBCStoreManager.class, JDBCFetchPlanImpl.class);
if (!(c instanceof JDBCConfigurationImpl))
return;
+
((JDBCConfiguration)c).getStoreFacadeTypeRegistry().registerImplementation(FetchPlan.class,
+ JDBCStoreManager.class, JDBCFetchPlanImpl.class);
JDBCConfigurationImpl conf = (JDBCConfigurationImpl) c;
String jpa = PersistenceProductDerivation.SPEC_JPA;
@@ -65,10 +71,12 @@
PersistenceMappingDefaults.class.getName());
}
- public void afterSpecificationSet(OpenJPAConfiguration c) {
+// public void beforeConfigurationLoad(OpenJPAConfiguration c) {
+ public void afterSpecificationSet(Configuration c) {
String jpa = PersistenceProductDerivation.SPEC_JPA;
if (!(c instanceof JDBCConfigurationImpl)
- || !jpa.equals(c.getSpecification()))
+// || !jpa.equals(c.getSpecification()))
+ || !jpa.equals(((OpenJPAConfiguration)c).getSpecification()))
return;
JDBCConfigurationImpl conf = (JDBCConfigurationImpl) c;
Copied:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation
(from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation)
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation?view=diff&rev=442619&p1=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation&r1=440888&p2=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence-jdbc/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation&r2=442619
==============================================================================
(empty)
Modified:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java?view=diff&rev=442619&r1=442618&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
Tue Sep 12 08:31:34 2006
@@ -17,7 +17,8 @@
import org.apache.openjpa.conf.OpenJPAConfiguration;
import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
-import org.apache.openjpa.conf.ProductDerivation;
+import org.apache.openjpa.conf.OpenJPAProductDerivation;
+import org.apache.openjpa.lib.conf.Configuration;
import org.apache.openjpa.lib.conf.ConfigurationProvider;
/**
@@ -27,7 +28,7 @@
* @nojavadoc
*/
public class PersistenceProductDerivation
- implements ProductDerivation {
+ implements OpenJPAProductDerivation {
public static final String SPEC_JPA = "jpa";
public static final String ALIAS_EJB = "ejb";
@@ -39,7 +40,8 @@
public void beforeConfigurationConstruct(ConfigurationProvider cp) {
}
- public void beforeConfigurationLoad(OpenJPAConfiguration c) {
+// public void beforeConfigurationLoad(OpenJPAConfiguration c) {
+ public void beforeConfigurationLoad(Configuration c) {
if (!(c instanceof OpenJPAConfigurationImpl))
return;
@@ -50,9 +52,11 @@
PersistenceMetaDataFactory.class.getName());
}
- public void afterSpecificationSet(OpenJPAConfiguration c) {
+// public void afterSpecificationSet(OpenJPAConfiguration c) {
+ public void afterSpecificationSet(Configuration c) {
if (!(c instanceof OpenJPAConfigurationImpl)
- || !SPEC_JPA.equals(c.getSpecification()))
+// || !SPEC_JPA.equals(c.getSpecification()))
+ || !SPEC_JPA.equals(((OpenJPAConfiguration) c).getSpecification()))
return;
OpenJPAConfigurationImpl conf = (OpenJPAConfigurationImpl) c;
Copied:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation
(from r440888,
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation)
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation?view=diff&rev=442619&p1=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/resources/META-INF/services/org.apache.openjpa.conf.ProductDerivation&r1=440888&p2=incubator/openjpa/sandboxes/OPENJPA-24/openjpa-persistence/src/main/resources/META-INF/services/org.apache.openjpa.conf.OpenJPAProductDerivation&r2=442619
==============================================================================
(empty)
Modified:
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLConfiguration.java
URL:
http://svn.apache.org/viewvc/incubator/openjpa/sandboxes/OPENJPA-24/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLConfiguration.java?view=diff&rev=442619&r1=442618&r2=442619
==============================================================================
---
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLConfiguration.java
(original)
+++
incubator/openjpa/sandboxes/OPENJPA-24/openjpa-xmlstore/src/main/java/org/apache/openjpa/xmlstore/XMLConfiguration.java
Tue Sep 12 08:31:34 2006
@@ -16,7 +16,7 @@
package org.apache.openjpa.xmlstore;
import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
-import org.apache.openjpa.conf.ProductDerivations;
+import org.apache.openjpa.conf.OpenJPAProductDerivations;
import org.apache.openjpa.kernel.Broker;
import org.apache.openjpa.kernel.BrokerFactory;
@@ -46,7 +46,7 @@
lockManagerPlugin.setDefault("version");
lockManagerPlugin.setString("version");
- ProductDerivations.beforeConfigurationLoad(this);
+ OpenJPAProductDerivations.beforeConfigurationLoad(this);
loadGlobals();
}