openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r1194953 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/ openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence/src/main/java/...
Date Sat, 29 Oct 2011 17:55:26 GMT
Author: ppoddar
Date: Sat Oct 29 17:55:26 2011
New Revision: 1194953

URL: http://svn.apache.org/viewvc?rev=1194953&view=rev
Log:
OPENJPA-2057: Change classloading scheme

Removed:
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/osgi/OSGiDerivation.java
Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ManagedClassSubclasser.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java?rev=1194953&r1=1194952&r2=1194953&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java
Sat Oct 29 17:55:26 2011
@@ -21,6 +21,7 @@ package org.apache.openjpa.abstractstore
 import java.util.Map;
 
 import org.apache.openjpa.conf.OpenJPAConfiguration;
+import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
 import org.apache.openjpa.kernel.AbstractBrokerFactory;
 import org.apache.openjpa.kernel.Bootstrap;
 import org.apache.openjpa.kernel.BrokerFactory;
@@ -48,6 +49,7 @@ import org.apache.openjpa.util.UserExcep
  * and bootstrapping from a {@link Map} object (the strategy used by
  * {@link Bootstrap} to create a factory in a vendor-neutral manner).
  */
+@SuppressWarnings("serial")
 public class AbstractStoreBrokerFactory
     extends AbstractBrokerFactory {
 
@@ -55,11 +57,9 @@ public class AbstractStoreBrokerFactory
      * The property name under which to name the concrete store manager
      * class for this runtime.
      */
-    private static final String PROP_ABSTRACT_STORE =
-        "abstractstore.AbstractStoreManager";
+    private static final String PROP_ABSTRACT_STORE = "abstractstore.AbstractStoreManager";
 
-    private static final Localizer s_loc = Localizer.forPackage
-        (AbstractStoreBrokerFactory.class);
+    private static final Localizer s_loc = Localizer.forPackage(AbstractStoreBrokerFactory.class);
 
     private String _storeCls = null;
     private String _storeProps = null;
@@ -71,8 +71,7 @@ public class AbstractStoreBrokerFactory
      */
     public static AbstractStoreBrokerFactory getInstance(ConfigurationProvider cp) {
         Object key = toPoolKey(cp.getProperties());
-        AbstractStoreBrokerFactory factory = (AbstractStoreBrokerFactory)
-            getPooledFactoryForKey(key);
+        AbstractStoreBrokerFactory factory = (AbstractStoreBrokerFactory)getPooledFactoryForKey(key);
         if (factory != null)
             return factory;
 
@@ -89,11 +88,12 @@ public class AbstractStoreBrokerFactory
         // use a tmp store manager to get metadata about the capabilities of
         // this runtime
         Map map = cp.getProperties();
-        String storePlugin = (String) map.get(ProductDerivations
-            .getConfigurationKey(PROP_ABSTRACT_STORE, map));
+        OpenJPAConfiguration tmp = new OpenJPAConfigurationImpl();
+        cp.setInto(tmp);
+        String storePlugin = (String) map.get(ProductDerivations.getConfigurationKey(PROP_ABSTRACT_STORE,
map));
         String storeCls = Configurations.getClassName(storePlugin);
         String storeProps = Configurations.getProperties(storePlugin);
-        AbstractStoreManager store = createStoreManager(storeCls, storeProps);
+        AbstractStoreManager store = createStoreManager(storeCls, tmp, storeProps);
 
         // populate configuration
         OpenJPAConfiguration conf = store.newConfiguration();
@@ -101,8 +101,7 @@ public class AbstractStoreBrokerFactory
         conf.supportedOptions().removeAll(store.getUnsupportedOptions());
 
         // create and pool a new factory
-        return new AbstractStoreBrokerFactory(conf, storeCls, storeProps,
-            store.getPlatform());
+        return new AbstractStoreBrokerFactory(conf, storeCls, storeProps, store.getPlatform());
     }
 
     /**
@@ -123,12 +122,12 @@ public class AbstractStoreBrokerFactory
     }
 
     protected StoreManager newStoreManager() {
-        return createStoreManager(_storeCls, _storeProps);
+        return createStoreManager(_storeCls, new OpenJPAConfigurationImpl(), _storeProps);
     }
 
-    private static AbstractStoreManager createStoreManager(String cls, String props) {
+    private static AbstractStoreManager createStoreManager(String cls, OpenJPAConfiguration
conf, String props) {
         AbstractStoreManager store =
-            (AbstractStoreManager) Configurations.newInstance(cls, (Configuration)null, props);

+            (AbstractStoreManager) Configurations.newInstance(cls, conf, props); 
         Configurations.configureInstance(store, null, props, PROP_ABSTRACT_STORE);
         if (store == null)
             throw new UserException(s_loc.get("no-store-manager",

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ManagedClassSubclasser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ManagedClassSubclasser.java?rev=1194953&r1=1194952&r2=1194953&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ManagedClassSubclasser.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ManagedClassSubclasser.java
Sat Oct 29 17:55:26 2011
@@ -93,7 +93,7 @@ public class ManagedClassSubclasser {
                 if (!PersistenceCapable.class.isAssignableFrom(cls))
                     unenhanced.add(cls);
             if (unenhanced.size() > 0) {
-                if (PCEnhancerAgent.getLoadSuccessful() == true) {
+                if (PCEnhancerAgent.getLoadSuccessful()) {
                     // This means that the enhancer has been ran but we
                     // have some unenhanced classes. This can happen if an
                     // entity is loaded by the JVM before the EntityManger

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java?rev=1194953&r1=1194952&r2=1194953&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
Sat Oct 29 17:55:26 2011
@@ -19,7 +19,6 @@
 package org.apache.openjpa.kernel;
 
 import java.io.ObjectStreamException;
-import java.security.AccessController;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -40,7 +39,6 @@ import javax.transaction.TransactionMana
 
 import org.apache.commons.collections.set.MapBackedSet;
 import org.apache.commons.lang.StringUtils;
-import org.apache.openjpa.kernel.AuditManager;
 import org.apache.openjpa.audit.Auditor;
 import org.apache.openjpa.conf.BrokerValue;
 import org.apache.openjpa.conf.OpenJPAConfiguration;

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java?rev=1194953&r1=1194952&r2=1194953&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
Sat Oct 29 17:55:26 2011
@@ -43,7 +43,6 @@ import org.apache.openjpa.kernel.Connect
 import org.apache.openjpa.lib.conf.Configuration;
 import org.apache.openjpa.lib.conf.ConfigurationProvider;
 import org.apache.openjpa.lib.conf.Configurations;
-import org.apache.openjpa.lib.conf.ProductDerivation;
 import org.apache.openjpa.lib.conf.ProductDerivations;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.Localizer;
@@ -51,9 +50,7 @@ import org.apache.openjpa.meta.AbstractC
 import org.apache.openjpa.meta.MetaDataModes;
 import org.apache.openjpa.meta.MetaDataRepository;
 import org.apache.openjpa.persistence.osgi.BundleUtils;
-import org.apache.openjpa.persistence.osgi.OSGiDerivation;
 import org.apache.openjpa.persistence.validation.ValidationUtils;
-import org.apache.openjpa.util.ClassResolver;
 
 
 /**



Mime
View raw message